
v3.0
パラメータの推奨最小値(Variant)を戻します。パラメータには異なる 2 つの範囲値、つまり、有効値の全範囲を定義する Min/Max 値を設定できます。一方、Suggested Minimum/Suggested Maximum は、実質的に有効な Min/MaX の範囲を定義します。
たとえば、ジオメトリには理論上は非常に多数のサブディビジョンを設定できますが、パフォーマンスの点から、ユーザに推奨できる範囲はそれよりも小さくなります。Suggested Min/Max値は、パラメータが検証されるときに、コントロールのスライダ範囲を決定するときに使用されます。
このプロパティは数値パラメータの場合にのみ有効です。siString(siVariantType を参照)などのその他の他のバリアント型には、最小値または最大値という概念はありません。
// get accessor Object rtn = Parameter.SuggestedMin; |
'
' This example demonstrates how the Suggested Min and Max of a parameter can
' be useful for animating a parameter.
'
NewScene , false
' Set up a custom property set with some numeric values
set oRoot = Application.ActiveProject.ActiveScene.Root
set oPropSet = oRoot.AddProperty("Custom_parameter_list",,"TestRanges")
oPropSet.AddParameter "Var1", siDouble,,siPersistable OR siAnimatable
oPropSet.AddParameter "Var2", siUByte,,siPersistable OR siAnimatable
oPropSet.AddParameter "Var3", siInt4,,siPersistable OR siAnimatable
oPropSet.AddParameter "Comment", siString
' Animate all the parameters
for each oProp in oPropSet.Parameters
AnimateOverSuggestedRange oProp
next
InspectObj oPropSet
' This routine animates a parameter between suggested Min and suggested Max between the
' Frames 1 and 100
sub AnimateOverSuggestedRange( in_Parameter )
' We only try to animate numeric parameters
if ( in_Parameter.ValueType = siInt4 OR _
in_Parameter.ValueType = siDouble OR _
in_Parameter.ValueType = siUByte OR _
in_Parameter.ValueType = siFloat ) then
SetKey in_Parameter.FullName, 1, in_Parameter.SuggestedMin
SetKey in_Parameter.FullName, 100, in_Parameter.SuggestedMax
end if
end sub
' Expected results:
'SetKey "TestRanges.Var1", 1, 0.5
'SetKey "TestRanges.Var1", 100, 0.6
'SetKey "TestRanges.Var2", 1, 10
'SetKey "TestRanges.Var2", 100, 30
'SetKey "TestRanges.Var3", 1, -100
'SetKey "TestRanges.Var3", 100, 9999 |