v1.0
property
カスタム パラメータ セットにカスタム パラメータを追加します。
SIAddCustomParameter( [InputObj], [ScriptName], [VarType], DefaultValue, [MinValue], [MaxValue], [Classification], [Capabilities], [SuggMin], [SuggMax], [ParamName], [Description] ); |
| パラメータ | タイプ | 詳細 |
|---|---|---|
| InputObj | 文字列 | カスタム パラメータ セットのリスト
デフォルト値: 現在選択されている値 |
| ScriptName | 文字列 | 追加されるカスタム パラメータのスクリプト名。 通常は「rotx」のような短い名前です。
スクリプト名にスペースを含めることはできません。
デフォルト値: "ParamName" |
| VarType | siVariantType | パラメータの型。
デフォルト値: siDouble |
| DefaultValue | Variant | パラメータのデフォルト値 |
| MinValue | ダブル | パラメータの最小値
デフォルト値: 0.0 |
| MaxValue | ダブル | パラメータの最大値
デフォルト値: 1.0 |
| Classification | siParamClassification | パラメータの分類を決定します(パラメータの目的に関する情報をSoftimageに渡します。詳細については、siParamClassification列挙型を参照してください)。
デフォルト値: siClassifUnknown |
| Capabilities | siCapabilities | パラメータの機能を決定します(詳細については、siCapabilities列挙型を参照してください)。
デフォルト値: 5 (siAnimatable + siPersistable) |
| SuggMin | ダブル | パラメータの推奨最小値(UI コントロール用)
デフォルト値: MinValue |
| SuggMax | ダブル | パラメータの推奨最大値(UI コントロール用)
デフォルト値: MaxValue |
| ParamName | 文字列 | スクリプト名よりも詳細な名前を付けられるパラメータの名前です。 たとえば、「rotx」の代わりに「RotationX」と命名できます。 |
| 詳細 | 文字列 | パラメータの説明 |
'Example showing you a custom pset can be used, in conjunction with the
'InspectObj command to collect information from a user
dim oCustomProperty
dim nbJoints, useCns
'Create a temporary custom property (it is not part of the scene)
Set oPreset = CreatePreset( "CustomProperty", "Properties" )
Set oCustomProperty = CreateObjectFromPreset(oPreset, "Chain_From_Curve" )
'Add parameters to the custom property
SIAddCustomParameter oCustomProperty , _
"nbJoints", siInt2, 10, 1, 1000, 8, 16, 1, 100, "Bones", "Number of Bones"
SIAddCustomParameter oCustomProperty , _
"useCns", siBool, FALSE, , , 8, 16, , , "Constrain", "Constrain Chain to Curve"
' Launch the ppg in modal mode, wait for Ok or Cancel to be pressed
On Error Resume Next
InspectObj oCustomProperty ,,,4
' If the user Clicked Ok, get the values entered in the ppg
if Err.Number = 0 then
'Get the dialog values
nbJoints = GetValue( oCustomProperty & ".nbJoints" )
useCns = GetValue( oCustomProperty & ".useCns" )
'At this point you could launch a custom command
'using nbJoints and useCns as
else
' Put your cancel code here
end if
|
'Example demonstrating how the arguments to SIAddCustomParameter
'are exposed in the Object Model
dim oCustomProperties, oCustomProperty, oParam
SIAddProp "Custom_parameter_list", ActiveSceneRoot , , "DemoProp", oCustomProperties
'We only created a single custom property because we only
'passed a single object (ActiveSceneRoot) to SIAddProp
set oCustomProperty = oCustomProperties.Item(0)
SIAddCustomParameter oCustomProperty , _
"nbJoints", siInt4, 10, 1, 1000, 8, 16, 1, 100, "Bones"
set oParam = oCustomProperty.Parameters( "nbJoints" )
logmessage "Parameter Name: " & oParam.Name
logmessage "Parameter Script Name: " & oParam.ScriptName
logmessage "Parameter ValueType: " & oParam.ValueType
logmessage "Parameter Default: " & oParam.Default
logmessage "Parameter Min/Max: " & oParam.Min & "/" & oParam.Max
logmessage "Parameter UI Min/Max: " & oParam.SuggestedMin & "/" & oParam.SuggestedMax
'Output of running this script:
'INFO : "Parameter Name: Bones"
'INFO : "Parameter Script Name: nbJoints"
'INFO : "Parameter ValueType: 3"
'INFO : "Parameter Default: 10"
'INFO : "Parameter Min/Max: 1/1000"
'INFO : "Parameter UI Min/Max: 1/100"
|