X3DObject.GetActivePrimitive2
 
 
 

X3DObject.GetActivePrimitive2

Introduced

v9.0 (2011)

Description

Returns the 3D object's active Primitive for a given frame.

Note: Although the scene root is a kind of Model it does not support primitives. In this case this function will return Nothing.

This method has the added convenienence of allowing sequential evaluation of simulation objects without risking a simulation restart because the scene time and given time don't match.

Note: This method could return an invalid object in python, use X3DObject.GetActivePrimitive3 instead.

C# Syntax

Primitive X3DObject.GetActivePrimitive2( Object in_Frame );

Scripting Syntax

oReturn = X3DObject.GetActivePrimitive2( [Time] );

Return Value

Primitive

Parameters

Parameter Type Description
Time Double Time (in frames) at which to get the primitive

Default Value: Current time in frames

Examples

Python Example

#
#       This example illustrates how to get the active primitive object from an 
#       X3DObject object and how to detect if the object supports primitives.
#
from win32com.client import constants
Application.NewScene( None, False )
cube = Application.ActiveSceneRoot.AddGeometry( "Cube", "MeshSurface" )
twist = Application.ApplyOp("Twist", cube, 3, "siPersistentOperation", None, 0)[ 0 ]
twist.angle.AddFcurve( None, constants.siLinearInterpolation, None, [ 1.0, 0.0, 10.0, 180.0 ] )
Application.LogMessage( cube.ActivePrimitive.Geometry.Points[ 5 ].Position.Y )
Application.LogMessage( cube.GetActivePrimitive2(5).Geometry.Points[ 5 ].Position.Y )
# Expected results:
# INFO : -4.0
# INFO : 3.24463830138

See Also

X3DObject.ActivePrimitive