Returns information about the object's type as a String. In many cases it
returns the same result as Application.ClassName but in other cases it
returns a more specific result that further categorizes the object. The returned value
is not necessarily the name of an object in the Object Model.
Some examples:
A Phong Shader returns "Shader" as its type. (To distinguish
between shaders use Shader.ProgID.)
An Infinite Light returns "light" as its type.
A Null returns "null" as its type.
A turbulence force returns "turbulence" as its type.
A polygon mesh cylinder returns returns "polymsh" as its type. The active
Primitive of a polygon mesh cylinder also returns "polymsh" as its type.
A nurbs surface cylinder returns returns "surfmsh" as its type.
The visibility Property returns "visibility" as its type.
An instance of a self-installed CustomProperty returns the name of its
PluginItem as its type. A dynamically-created or spdl-based CustomProperty
returns "customparamset" as its type.
The scene root and other Models in the scene return "#model" as their type.
An FCurve does not support SIObject, however it also has its own
Type property which returns information about the siFCurveType.
A Clip returns one of the values from the siClipType constant.
A Track returns one of the values from the siTrackType constant.
A Transition returns one of the values from the siTransitionType constant.
A AnimationSourceItem returns one of the values from the
siAnimationSourceItemType enum.
A MappedItem returns one of the values from the siMappedItemType constant.
SIVector3, PPG, and Image are examples
of objects which do not support SIObject and do not support a Type property.
See Object Hierarchy for more details.
A Filter returns one of the siFilterFundamentalType values. For
example, a point filter reports the string "SubComponentFilter", not the number 5 (which is the value
for siFilterSubComponentPoint of the siFilterType enum).
An EventInfo returns the type of event (for example, "OnBeginNewScene" or "OnEndNewScene"). See
the Description column of the siEventID enumerator for a list of supported event types.
An ActionDelta and ActionDeltaItem return the type of modification
as one of the siModificationDeltaType enum values.
// get accessor String rtn = SIObject.Type; |
' ' This example displays the type of an object ' set oObj = ActiveProject.ActiveScene.Root.AddGeometry("Sphere", "NurbsSurface") LogMessage "Object type = " & oObj.Type |
/* This example demonstrates using the SIObject.Type property to distinguish objects of a certain type inside a collection */ // First fill a collection will many different types of objects var oCollection = new ActiveXObject( "XSI.Collection" ) ; oCollection.Add( ActiveSceneRoot.AddNull() ); oCollection.Add( ActiveSceneRoot.AddGeometry("Cone","MeshSurface") ); oCollection.Add( ActiveSceneRoot.AddGeometry("Cube","MeshSurface") ); oCollection.Add( ActiveSceneRoot.AddGeometry("Cube","NurbsSurface") ); oCollection.Add( ActiveSceneRoot.AddProperty( "CustomProperty", false ) ); oCollection.Add( ActiveSceneRoot.AddGeometry("Cylinder","NurbsSurface") ); oCollection.Add( ActiveSceneRoot.AddParticleCloud() ); // Next filter the collection var oFilteredCollection = FindNurbsSurfaces( oCollection ); // Expect that there are 2 (Cube1 and Cylinder) Application.LogMessage( "There are " + oFilteredCollection.Count + " Nurbs objects" ) ; // Function that takes an XSICollection and returns a new // XSICollection containing only the Nurbs Surfaces that // were in the input function FindNurbsSurfaces( in_Collection ) { var oReturnCollection = new ActiveXObject( "XSI.Collection" ) ; for ( var i = 0 ; i < in_Collection.Count ; i++ ) { if ( in_Collection.Item(i).Type == "surfmsh" ) { oReturnCollection.Add( in_Collection.Item(i) ) } } return oReturnCollection ; } |