Object Hierarchy | 関連する C++クラス:Parameter
パラメータ
v1.5
オブジェクトの属性を定義するパラメータ値です(例:twist オペレータの角度パラメータやライトのカラーなど)。パラメータ(プロパティとも呼ばれる)は、パラメータセット(Cone.kine.ltransfo.pos.posx?Iposx)の「原子」エレメントであり、その値により対象物の動作が決まります。
注:パラメータセット(プロパティセット)はパラメータのコレクションです。その値により、見た目、動作が決定されるほか、単にシーン内エレメントに関する情報を提供することもあります。パラメータセット(スクリプト用の Property オブジェクト)には、ビューポートに表示されるオブジェクトのビジュアル面を定義するパラメータ、時間などのモーション情報を提供するパラメータ、メソッド固有の操作の実行制御用に内部で使用されるパラメータなどがあります。
ユーザインターフェイスでは、ほとんどのパラメータセットのパラメータをプロパティエディタから編集し、アニメートさせることができます。関連付けられているパラメータは、通常プロパティエディタ内のプロパティページに表示されます。
オブジェクトモデルでは、Parameter オブジェクトは ParameterCollection のメンバであり、ProjectItem.Parameters を使用して取得できます。また、CustomProperty オブジェクトを使用して、カスタム定義パラメータを作成できます(CustomProperty.AddParameter および CustomProperty.AddParameter2 を参照)。
Softimage で通常のパラメータを表す他に、このオブジェクトは ArrayParameter、ShaderParameter、ProxyParameter など多数の特殊化の基本クラスになります。
詳細については、Softimage ユーザ ガイドの「オブジェクト階層」を参照してください。
'
' This example shows how to loop through all parameters on the object
'
NewScene , false
' Access Parameters Directly Off the Object
Set oRoot = Application.ActiveProject.ActiveScene.Root
Set oCube = oRoot.AddGeometry("Cube", "MeshSurface", "MyCube")
' Print the names of all parameter exposed by the cube object
For Each oParameter In oCube.Parameters
LogMessage oParameter.ScriptName & " = " & oParameter.Value
Next
' Expected results:
'INFO : "Name = MyCube"
'INFO : "blendweight = 1"
'INFO : "active = True"
'INFO : "posx = 0"
'INFO : "posy = 0"
'INFO : "posz = 0"
'INFO : "rotx = 0"
'INFO : "roty = 0"
'INFO : "rotz = 0"
'INFO : "quatw = 1"
'INFO : "quatx = 0"
'INFO : "quaty = 0"
'INFO : "quatz = 0"
'INFO : "sclx = 1"
'INFO : "scly = 1"
'INFO : "sclz = 1"
'INFO : "sclorix = 0"
'INFO : "scloriy = 0"
'INFO : "scloriz = 0"
'INFO : "cnsscl = True"
'INFO : "cnsori = True"
'INFO : "cnspos = True"
'INFO : "affbyscl = True"
'INFO : "affbyori = True"
'INFO : "posxmaxactive = False"
'INFO : "posxminactive = False"
'INFO : "posymaxactive = False"
'INFO : "posyminactive = False"
'INFO : "poszmaxactive = False"
'INFO : "poszminactive = False"
'INFO : "rotxmaxactive = False"
'INFO : "rotxminactive = False"
'INFO : "rotymaxactive = False"
'INFO : "rotyminactive = False"
'INFO : "rotzmaxactive = False"
'INFO : "rotzminactive = False"
'INFO : "siscaling = True"
'INFO : "rotorder = 0"
'INFO : "subdivu = 1"
'INFO : "subdivv = 1"
'INFO : "subdivbase = 1"
'INFO : "length = 8" |
'
' This example demonstrates how to get at individual parameters; if you change the value of
' a parameter you want to access through the UI, you can get its name to use in your script.
' For example, toggling the View Visibility parameter of a torus logs the following message
' to the Script Editor History pane:
'
' SetValue "torus.visibility.viewvis", False
'
NewScene , false
'
' How to Access Parameters (the Long Way)
'
' First get the camera (Camera object)
Set oCamera = ActiveSceneRoot.FindChild( , "camera" )
' Underneath the camera are its properties (Properties returns the PropertyCollection)
Set oProps = oCamera.Properties
' Once you have all the property sets (PropertyCollection) you can specify the one you
' want (the Property object is returned)
Set oVis = oProps( "visibility" )
' Now you have a single Property (property set), so you need to get all the
' parameters for that property set (Parameters returns the ParameterCollection)
Set oParams = oVis.Parameters
' Again you choose the single parameter you want from the collection (the
' Parameter object is returned)
Set oViewVis = oParams( "viewvis" )
'
' How to Get Parameter Values
'
' And once you have a single Parameter object, you can get it's value...
bOldValue = oViewVis.Value
LogMessage "Parameter originally was set to " & oViewVis.Value
'
' How to Set Parameter Values
'
' ...or set it...
oViewVis.Value = not(bOldValue)
LogMessage "Parameter has been changed to " & oViewVis.Value
'
' How to Access Parameters (the Short Way)
'
' ...and you can make as many shortcuts as you like, so...
oCamera.Properties("visibility").Parameters("viewvis").Value = not(bOldValue)
LogMessage "Parameter is back to " & oViewVis.Value
' Expected result:
'INFO : "Parameter originally was set to False"
'INFO : "Parameter has been changed to True"
'INFO : "Parameter is back to True" |