CustomProperty

Object Hierarchy | 関連する C++クラス:CustomProperty

継承

SIObject

ProjectItem

Property

CustomProperty

導入

v1.5

詳細

カスタムプロパティオブジェクトです。カスタムプロパティは、ユーザまたはスクリプトによって作成されるパラメータのセットを保持します。カスタムプロパティは、ゲームエンジンの属性などのようなユーザ定義データの保存に使用できます。オブジェクトモデルを使用することで、ユーザ定義データを Softimage シーン内のオブジェクトのように操作できます。

メソッド

AddCustomOp AddFCurveParameter AddGridParameter AddParameter
AddParameter2 AddParameter3 AddParameterFromDef AddProxyParameter
AddScriptedOp AddScriptedOpFromFile AnimatedParameters2 BelongsToオペレータ
EvaluateAt GetICEAttributeFromName IsA IsAnimated2
IsClassOfオペレータ IsEqualToオペレータ IsKindOf IsLockedオペレータ
IsSelectedオペレータ LockOwners RemoveParameter SetAsSelectedオペレータ
SetCapabilityFlagオペレータ SetLock TaggedParameters UnSetLock

プロパティ

Application BinaryDataオペレータ Branchオペレータ BranchFlagオペレータ
Capabilitiesオペレータ Categories EvaluationID Familiesオペレータ
FullNameオペレータ Help HierarchicalEvaluationID ICEAttributes
LockLevelオペレータ LockMastersオペレータ LockTypeオペレータ Model
Nameオペレータ NestedObjects ObjectID Origin
OriginPath Owners PPGLayoutオペレータ Parametersオペレータ
Parent Parent3DObject Selectedオペレータ Singletonオペレータ
Typeオペレータ      
       

1. VBScript の例

'VBScript example : find the custom properties on an object
set oSphere = ActiveProject.ActiveScene.Root.AddGeometry("Sphere", "NurbsSurface")
'Add two empty custom property sets
oSphere.AddProperty "Custom_parameter_list",,"MyFirstCustomProperty"
oSphere.AddProperty "Custom_parameter_list",,"MySecondCustomProperty"
'List all the custom property sets on the object
for each oLocalProp in oSphere.LocalProperties
if ( oLocalProp.Type = "customparamset" ) then
                logmessage oLocalProp.Name & ", " & oLocalProp.Type & ", " & typename(oLocalProp)
end if
next 
'Results of running this script:
'INFO : "MyFirstCustomProperty, customparamset, CustomProperty"
'INFO : "MySecondCustomProperty, customparamset, CustomProperty"

2. VBScript の例

'VBScript example : Demonstrate creating a cluster with custom property set based on the
'                   selected points
'Setup the scenario
CreatePrim "Grid", "MeshSurface"
DeselectAll
ActivateVertexSelTool
SelectGeometryComponents "grid.pnt[34,35,42-44]"
'Now based on selection we create a cluster and property set on the cluster
dim oObj, oNewCluster, oPSet
dim item
set oObj = application.selection
set item = oObj.Item(0)
if ( item.Type = "pntSubComponent" ) then
        set oNewCluster = item.SubComponent.CreateCluster( "MyPointCluster" )
        'Add custom property set to the new cluster
        set oPSet = oNewCluster.AddProperty("Custom_parameter_list",,"MyClusterPSet")
        oPSet.AddParameter "StrCustomParam", siString                                                           
        oPSet.Parameters( "StrCustomParam" ).Value = "TestValue"
        logmessage oPSet.Parameters( "StrCustomParam" ).FullName
end if
'Results of running this script
'INFO : "grid.polymsh.cls.MyPointCluster.MyClusterPSet.StrCustomParam"

3. JScript の例

var app = Application;
var root = app.ActiveSceneRoot;
var nullobj;
nullobj = root.AddNull( "" );
var cpset;
cpset = nullobj.AddCustomProperty("MyCustomPSet", false );
var x, y, bitfield, label, flag, unused;
x = cpset.AddParameter( "x", siDouble, siClassifUnknown, siAnimatable, "Double", "Double X", unused, 10.0, 0.0, 100.0, 10.0, 90.0 );
y = cpset.AddParameter( "y", siInt4, siClassifUnknown, siAnimatable, "Integer", "Integer Y", unused, 10, 0, 100, 10, 90 );
z = cpset.AddParameter( "x", siDouble, siClassifUnknown, siAnimatable, "Double", "Double Z" );
label = cpset.AddParameter( "label", siString, siClassifUnknown, siAnimatable, "Text", "Text Field", unused, "Hello World" );
flag = cpset.AddParameter( "flag", siBool, siClassifUnknown, siAnimatable, "Flag", "Boolean Field", unused, true );
bitfield = cpset.AddParameter( "bitfield", siUByte, siClassifUnknown, siAnimatable, "UByte", "Bitfield", 32 );

関連項目

Property Parameter SceneItem.AddProperty RemoveCustomParam EditParameterDefinition AddProxyParam RemoveProxyParam Definition Callbacks for Custom Properties