CustomProperty

Object Hierarchy | Related C++ Class: CustomProperty

Inheritance

SIObject

ProjectItem

Property

CustomProperty

Introduced

v1.5

Description

Represents a custom property object. A custom property holds a set of parameters which can be created by the user or by scripting. A custom property can be used to store user defined data such as attributes for a game engine. Using the object model this data can be manipulated just like any other property within a Softimage scene.

Methods

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

Properties

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

Examples

1. VBScript Example

'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 Example

'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 Example

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 );

See Also

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