オブジェクトのタイプに関する情報を 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 つとして変更のタイプを戻します。
// 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 ; } |