特定のパラメータからアニメーション(F カーブ、エクスプレッション、コンストレイント)を削除します。 このコマンドを使ってアニメーションを削除した後、どの種類のパラメータを指定するかも指定できます。
デフォルトでは、現在のフレームのパラメータ値が新しい値として設定されます。 しかし、Frame 引数が指定されている場合は、指定フレームのパラメータ値から値を取得し、新しい値として設定します。 注: コンストレイントの場合、指定されたパラメータからだけでなく、影響するすべてのパラメータからコンストレイントが削除されます。
RemoveAnimation( [InputObjs], [Time], [StaticFCurves], [BaseAnimation], [LayerAnimation], [SourceMask] ); |
| パラメータ | タイプ | 説明 |
|---|---|---|
| InputObjs | 文字列 |
アニメート可能なパラメータのリスト (例: cone*/kine.local.pos)。 デフォルト値:現在選択され、マーキングされているパラメータ |
| Time | Double |
アニメーションが削除されると、このフレームのアニメートされた値がパラメータに割り当てられます。 デフォルト値: 現在のフレーム |
| StaticFCurves | Boolean |
True の場合はスタティック(コンスタント) F カーブのみを削除します。 デフォルト値: False |
| BaseAnimation | Boolean |
True の場合、このコマンドによってベース レイヤ上のアニメーションが削除されます。 デフォルト値: True |
| LayerAnimation | Boolean |
True の場合、このコマンドによってベース レイヤを除くすべてのレイヤ上のアニメーションが削除されます。 デフォルト値: True |
| SourceMask | siSourceType |
削除するアニメーション ソースのタイプ デフォルト値: siAnySource |
'
' This example sets up some animation on an object on both
' the X and Y positions. Then it demonstrates two different
' ways to remove the replace the animation while removing it:
' first by passing a specific frame; and then by using the
' (default) current frame.
'
NewScene , false
' Create the object on which to set an 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
printInfo oDonut & ".kine.local.posx", Array( 1 ), "before"
SaveKey oDonut & ".kine.local.posx", 1, -30
printInfo oDonut & ".kine.local.posx", Array( 1 ), "after"
' Set another key frame at frame 100, with XPos = 30
printInfo oDonut & ".kine.local.posx", Array( 100 ), "before"
SaveKey oDonut & ".kine.local.posx", 100, 30
printInfo oDonut & ".kine.local.posx", Array( 100 ), "after"
' 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
' Remove the YPos expression and freeze Y at the value of
' the animation expression at frame 53
printInfo oDonut & ".kine.local.posy", Array( 1,50,53,100 ), "before"
RemoveAnimation oDonut & ".kine.local.posy", 53
printInfo oDonut & ".kine.local.posy", Array( 1,50,53,100 ), "after"
' Set current frame to 50
SetValue "PlayControl.Current", 50
' Remove XPos fcurve and freeze X at the value of the
' fcurve at the current frame (frame 50)
printInfo oDonut & ".kine.local.posx", Array( 1,50,53,100 ), "before"
RemoveAnimation oDonut & ".kine.local.posx"
printInfo oDonut & ".kine.local.posx", Array( 1,50,53,100 ), "after"
' This is a convenience function for printing out the info easily
function printInfo( in_parameter, in_frame, in_loc )
LogMessage "-----"
for each f in in_frame
LogMessage in_parameter & " parameter at frame " & f & " " _
& in_loc & " updating = " & GetValue( in_parameter, f )
next
end function
' Output of above script:
' INFO : -----
' INFO : torus.kine.local.posx parameter at frame 1 before updating = 0
' INFO : -----
' INFO : torus.kine.local.posx parameter at frame 1 after updating = -30
' INFO : -----
' INFO : torus.kine.local.posx parameter at frame 100 before updating = -30
' INFO : -----
' INFO : torus.kine.local.posx parameter at frame 100 after updating = -30
' INFO : -----
' INFO : torus.kine.local.posy parameter at frame 1 before updating = -5
' INFO : torus.kine.local.posy parameter at frame 50 before updating = -0.593575239181519
' INFO : torus.kine.local.posy parameter at frame 53 before updating = 2.80044293403625
' INFO : torus.kine.local.posy parameter at frame 100 before updating = 5
' INFO : -----
' INFO : torus.kine.local.posy parameter at frame 1 after updating = 2.80044293403625
' INFO : torus.kine.local.posy parameter at frame 50 after updating = 2.80044293403625
' INFO : torus.kine.local.posy parameter at frame 53 after updating = 2.80044293403625
' INFO : torus.kine.local.posy parameter at frame 100 after updating = 2.80044293403625
' INFO : -----
' INFO : torus.kine.local.posx parameter at frame 1 before updating = -30
' INFO : torus.kine.local.posx parameter at frame 50 before updating = -0.45452999539318
' INFO : torus.kine.local.posx parameter at frame 53 before updating = 2.27079487869202
' INFO : torus.kine.local.posx parameter at frame 100 before updating = 30
' INFO : -----
' INFO : torus.kine.local.posx parameter at frame 1 after updating = -0.454529995393187
' INFO : torus.kine.local.posx parameter at frame 50 after updating = -0.454529995393187
' INFO : torus.kine.local.posx parameter at frame 53 after updating = -0.454529995393187
' INFO : torus.kine.local.posx parameter at frame 100 after updating = -0.454529995393187 |