Object Hierarchy | 関連する C++クラス:Property
プロパティ
Property オブジェクトは、SceneItemのプロパティを表します。X3DObject、Model、Null、XSIProject、Group、Scene、Clusterなどの Propertyを持つサンプルSoftimage
オブジェクトです。
注:特定タイプのオブジェクトである Softimage Property
と、(メソッドに伴う)スクリプティングオブジェクトの一部であるプロパティを区別することは重要です。同様に、通常はオブジェクトの個々の数値属性である
Softimage Parameterオブジェクトと、Softimage
Property オブジェクトは異なるので注意してください。以上のような相違点を目でわかるように説明すると、Property
はプロパティページで表され、Parameter はプロパティページの各スライダです。
Visibility や Geometry Approximation
などのような一部のプロパティは、オブジェクトモデル内に特定のオブジェクトを持たず、Property
オブジェクトにより表されます。Material、ClusterProperty、UserDataMap、CustomProperty、StaticKinematicStateなどのその他の
Property には、Property から継承される専用のオブジェクトが存在します。
Property オブジェクトはローカルオブジェクトまたは共有オブジェクトです。親オブジェクトのローカルPropertY
のみを検索する場合は、SceneItem.LocalPropertiesプロパティが有効です。共有PropertY
のローカルコピーを作成する場合は、MakeLocalコマンドを使用します。共有Property内のすべての所有者を検索する場合は、ProjectItem.Ownersプロパティを使用します。共有プロパティには複数の親が存在するため、状況に応じてSIObject.Parentプロパティが異なるオブジェクトを戻すことがあります。
Property オブジェクトはParameterオブジェクトとして表示されることもあります。その他の場合は、ClusterProperty.ElementsやMaterial.CurrentImageClipなど、オブジェクト上の特定のプロパティとして表示されます。
'VBScript Example demonstrating the creation of a custom property
newscene ,false
set nullObj = Application.ActiveProject.ActiveScene.Root.AddNull
set customProp = nullObj.AddProperty("Custom_parameter_list",, "MyCustomParam")
'You can also access this property by name
set customProp = nullObj.Properties.Item("MyCustomParam")
'Custom Properties allow you to create your own paramters
customProp.AddParameter "DoubleCustomParam", siDouble, , siReadOnly, _
, , , 0.695, 0.0123, 10.456
LogMessage "Custom Property Name: " & customProp.Name
LogMessage "Custom Property Fullname: " & customProp.FullName
LogMessage "Custom Property Type: " & customProp.Type
'Output of this script:
'INFO : "Custom Property Name: MyCustomParam"
'INFO : "Custom Property Fullname: null.MyCustomParam"
'INFO : "Custom Property Type: customparamset"
|
'vbscript: Example of Shared and Local Properties in Softimage
newscene , false
'Create a cylinder. By default it will have several
'local and inherited properties
set oCyl = ActiveSceneRoot.AddGeometry( "Cylinder", "NurbsSurface" )
PrintPropertyList oCyl.LocalProperties, "LocalProperties of Cylinder"
PrintPropertyList oCyl.Properties, "Properties of Cylinder"
'We can access properties by name
set oKine = oCyl.Properties( "Kinematics" )
set oMaterial = oCyl.Properties( "Scene_Material" )
'However code like the previous line that assumes what the name
'of the material will be not ideal, because the material could
'be renamed as follows:
oMaterial.Name = "MyMaterial"
'So this is a safer way to access the material property
set oMaterial = oCyl.Material
logmessage "New material Name: " & oMaterial.Name
'Material is an example of a Shared Property
PrintPropertyList oMaterial.Owners, "Owners of Material "
'Because we accessed the shared object via the Cylinder it will
'say that the cylinder is the parent
logmessage "Parent of Material: " & oMaterial.Parent
'This is still the same Material
logmessage "Another parent of same material: " & _
ActiveSceneRoot.Material.Parent
'This will give the cylinder its own copy of the material
MakeLocal oCyl.Material
logmessage "Number of owners after calling MakeLocal: " & _
oCyl.Material.Owners.Count
'Little helper routine to print out a collection
sub PrintPropertyList( in_PropCollection, in_strHeading )
logmessage in_strHeading & " : "
dim oProp
for each oProp in in_PropCollection
logmessage " " & oProp.Name
next
end sub
|