アニメーション
指定のパラメータのエクスプレッションを編集する Expression Editor を開きます。
エクスプレッションは、オブジェクト、パラメータ名、算術演算子、および関数や定数を表すトークンを含む文字列です。 たとえば、オブジェクト
A の Y 軸回転をオブジェクト B の X 軸方向の移動に拘束するには、文字列 B.kine.local.posx
を含むエクスプレッションを A.kine.local.roty に設定します。
エクスプレッションは、移動、回転、スケーリング、マテリアル、テクスチャなどアニメーション化が可能な任意のパラメータを制御するために使用する、算術式です。
パラメータ間には、単純な "A = B"
のような関係から、定義済みの変数、標準数学関数、乱数ジェネレータなどを使用した非常に複雑な関係まで、必要に応じたほぼすべての関係を作成することができます。
エクスプレッションの詳細については、「アニメーション」を参照してください。
EditExpr( [InputObj] ); |
'
' This example sets an expression on a parameter using the SetExpr
' command and then uses the EditExpr command to open the Expression
' Editor to inspect the new expression.
'
NewScene , false
' Create the object on which to set the expression
set oDonut = CreatePrim( "Torus", "NurbsSurface" )
' Make sure the last frame will be set to 100
SetValue "PlayControl.Out", 100
' Set a key frame at frame 1, with XPos = -30
SaveKey oDonut & ".kine.local.posx", 1, -30
' Set another key frame at frame 100, with XPos = 30
SaveKey oDonut & ".kine.local.posx", 100, 30
' Temporarily disable cycle checking (this
' expression creates a cycle on purpose)
bCyclePref = GetValue( "preferences.data_management.disable_cycle_checking" )
SetValue "preferences.data_management.disable_cycle_checking", True
' Animate the YPos parameter with an expression
SetExpr oDonut & ".kine.local.posy", _
"5*sin(" & oDonut & ".kine.local.posx * 15)"
' Restore cycle checking to its previous value
SetValue "preferences.data_management.disable_cycle_checking", bCyclePref
' Now display the Expression Editor to see the results
EditExpr oDonut & ".kine.local.posy"
|