v6.0
Returns a Geometry object containing
the object's geometry.
Note: This is the Python-compliant version of the Primitive.Geometry property, which
gets the geometry at a specific frame. Since Python does not
support input parameters on properties, the Primitive.Geometry
property will fail in Python.
oReturn = Primitive.GetGeometry2( [Time], [Mode] ); |
Parameter | Type | Description |
---|---|---|
Time | Double | Time (in frames) at which to get property. Note: This argument is ignored inside operators. Default Value: Current time in frames |
Mode | siConstructionMode | The construction mode is used to access a version of the
geometry with specific deforms. The geometry positions you get
depends on the mode you pass in. By default this argument is set to
siConstructionModeSecondaryShape which combines the geometry
positions with the shape, the envelope deformation and the deforms
installed above the envelope such as the move point operators. This
mode is typically used for plotting the final results of shape and
envelope deformation. Other modes of interest: siConstructionModeModeling: Gets the original geometry positions. This mode is typically used in export applications where geometry, shape and envelope positions are exported separately. siConstructionModePrimaryShape: Combines the geometry positions with the shape deformation. siConstructionModeAnimation: Combines the geometry positions with the shape and envelope deformation altogether. siConstructionModeDefault: Uses the current construction mode set in Softimage. Note: This argument is ignored inside operators. Default Value: siConstructionModeSecondaryShape |
# # This example demontrates how to get position of a point at a specific time frame # # Import the constants from win32com.client import constants as c import sys, types Application.NewScene("", 0) oGrid = Application.ActiveSceneRoot.AddGeometry( "Grid", "MeshSurface" ) Application.SetValue (oGrid.Name + ".polymsh.geom.subdivu", 1) Application.SetValue (oGrid.Name + ".polymsh.geom.subdivv", 1) Application.Scale( oGrid, 0.25, 0.25, 0.25, c.siAbsolute, c.siParent, c.siObj, c.siXYZ) startTimeInSeconds = 5 / 29.97 duration = startTimeInSeconds * 2 # Start at frame 5 && last 100 frames oClip = oGrid.ActivePrimitive.Geometry.SaveShapeKey( startTimeInSeconds, duration, c.siShapeAbsoluteReferenceMode, c.siShapeInstanceOnlyMode, "Clip", ( 0,1,2,3), ( -4,0,-4, -4,0, 4, 4,0, 0, 4,0, 4 )) # Frame 3 should be the original grid oPoints = oGrid.ActivePrimitive.GetGeometry2(3,c.siConstructionModeSecondaryShape).Points oPos = oPoints[2].Position Application.LogMessage( "%f,%f,%f" % ( oPos.X,oPos.Y,oPos.Z ) ) # Frame 10 should the modified grid in the clip oPoints = oGrid.ActivePrimitive.GetGeometry2(10).Points oPos = oPoints[2].position Application.LogMessage( "%f,%f,%f" % ( oPos.X,oPos.Y,oPos.Z ) ) # Expected results: #INFO : 4.000000,0.000000,-4.000000 #INFO : 4.000000,0.000000,0.000000 |