PrevKey

カテゴリ

アニメーション

詳細

現在のフレームを、指定のアニメート パラメータの前のキー フレームに移動します。

スクリプト構文

oDouble = PrevKey( [InputObjs], [Time], [Tolerance], [Layer] );

戻り値

前のキーフレームのフレーム番号を、ダブルとして戻します。 キーがない場合は、-1#INF for C++, "-1.#INF" for VBScript and Number.NEGATIVE_INFINITY for JScript.

パラメータ

パラメータ タイプ 詳細
InputObjs 文字列 アニメート可能なパラメータのリスト (例: cone*/kine.local.pos)。

デフォルト値:現在選択され、マーキングされているパラメータ

Time Number このフレームの前のキーに移動します。

デフォルト値: 現在のフレーム

Tolerance ダブル フレームの許容範囲

デフォルト値:最も近い 0.5 フレーム(-1)

指定可能な値:

説明:

>0 Frame - Tolerance で、キーを取得します。
0 キーは正確にフレームの位置にある必要があります
-1 最も近い0.5フレーム
レイヤ Integer アニメーション レイヤ

デフォルト値:現在のアニメーションレイヤ(-1)

VBScript の例

' create a null with some animation
set o = getprim("null")
Translate o, -10, 5, 0, siRelative, siView, siObj, siXYZ
savekey o & "/kine.local.pos", 1
Translate o, 10, -5, 0, siRelative, siView, siObj, siXYZ
savekey o & "/kine.local.pos", 50
Translate o, 10, 5, 0, siRelative, siView, siObj, siXYZ
savekey o & "/kine.local.pos", 75
' Process all the keys prior to the current frame
LastFrame
PrevKeys ( o & "/kine.local.pos" )
sub PrevKeys (params)
        frame = PrevKey( params )
        do while frame <> "-1.#INF"
                LogMessage "There is a key at frame " & frame
                frame = PrevKey( params )
        loop
end sub 
'INFO : "There is a key at frame 75"
'INFO : "There is a key at frame 50"
'INFO : "There is a key at frame 1"

関連項目

AddFCurve RemoveAnimation RemoveAllAnimation SaveKey RemoveKey NextKey FirstKey LastKey FCurve.Keys