SIObject.Type operator

説明

オブジェクトのタイプに関する情報を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 プロパティを持っています。。

ClipsiClipType定数から値の 1 つを戻します。

TracksiTrackType定数から値の 1 つを戻します。

TransitionsiTransitionType定数から値の 1 つを戻します。

AnimationSourceItemsiAnimationSourceItemType列挙型から値の 1 つを戻します。

MappedItemsiMappedItemType定数から値の 1 つを戻します。

SIVector3PPG、およびImageは、SIObjectおよびType プロパティをサポートしないオブジェクトの例です。詳細については、Object Hierarchyを参照してください。

FiltersiFilterFundamentalType値の 1 つを戻します。たとえば、ポイントフィルタは、数値5(siFilterType列挙型の SiFilterSubComponentPoint の値)ではなく、文字列"SubComponentFilter"をレポートします。

EventInfoはイベントのタイプ("OnBeginNewScene"または"OnEndNewScene")を戻します。サポートされているイベントタイプのリストについては、siEventID列挙子の Description列を参照してください。

ActionDeltaおよびActionDeltaItemは、siModificationDeltaType列挙型値の 1 つとして変更のタイプを戻します。

1. VBScript の例

'
'       This example displays the type of an object
'
set oObj = ActiveProject.ActiveScene.Root.AddGeometry("Sphere", "NurbsSurface")
LogMessage "Object type = " & oObj.Type

2. JScript の例

/*
        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 ;
}

関連項目

Application.ClassName DataRepository.GetIdentifier ProjectItem.Families FCurve.Type