オブジェクトのタイプに関する情報をStringとして戻します。ほとんどの場合、Application.ClassNameと同一の結果を戻しますが、オブジェクトをより細かく分類して更に具体的な結果を戻すこともあります。戻される値は、オブジェクトモデルのオブジェクトの名前とは限りません。
例:
Phong Shader
は、「Shader」をタイプとして戻します。(シェーダを区別するには、Shader.ProgIDを使用してください)。
Infinite Lightは、"light"をタイプとして戻します。
Nullは、"null"をタイプとして戻します。
乱流フォースは、"turbulence"をタイプとして戻します。
ポリゴンメッシュシリンダは、"polymsh"をタイプとして戻します。ポリゴンメッシュシリンダのアクティブなPrimitiveも、"polymsh"をタイプとして戻します。
NURBS サーフェイスシリンダは、"surfmsh"をタイプとして戻します。
Visibility Propertyは、"visibility"をタイプとして戻します。
自己インストールCustomPropertyのインスタンスは、そのPluginItemの名前をタイプとして戻します。動的に作成される、または SPDL
ベースの CustomProperty は、"customparamset"をタイプとして戻します。
シーンルートおよびシーンの他のModelは、"#model"をタイプとして戻します。
FCurveではSIObjectはサポートされていませんが、siFCurveTypeに関する情報を戻す独自の Type
プロパティを持っています。。
ClipはsiClipType定数から値の 1 つを戻します。
TrackはsiTrackType定数から値の 1 つを戻します。
TransitionはsiTransitionType定数から値の 1 つを戻します。
AnimationSourceItemはsiAnimationSourceItemType列挙型から値の
1 つを戻します。
MappedItemはsiMappedItemType定数から値の 1 つを戻します。
SIVector3、PPG、およびImageは、SIObjectおよびType
プロパティをサポートしないオブジェクトの例です。詳細については、Object Hierarchyを参照してください。
FilterはsiFilterFundamentalType値の 1
つを戻します。たとえば、ポイントフィルタは、数値5(siFilterType列挙型の SiFilterSubComponentPoint
の値)ではなく、文字列"SubComponentFilter"をレポートします。
EventInfoはイベントのタイプ("OnBeginNewScene"または"OnEndNewScene")を戻します。サポートされているイベントタイプのリストについては、siEventID列挙子の
Description列を参照してください。
ActionDeltaおよびActionDeltaItemは、siModificationDeltaType列挙型値の 1
つとして変更のタイプを戻します。
' ' 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 ; } |