v3.0
指定されたフレームのキーを削除します。
注:F カーブがロックされている場合は、'Access Denied'(E_ACCESSDENIED)エラーが発生します。キーロックは、OverrideKeyLock 引数を使用して上書きできます。
FCurve.RemoveKey( Object in_Frame, Double in_Tolerance, Boolean in_OverrideKeyLock ); |
FCurve.RemoveKey( [Frame], [Tolerance], [OverrideKeyLock] ); |
| パラメータ | タイプ | 説明 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Frame | Variant(有効なキー時間) |
キーを削除する時間(フレーム) デフォルト値:現在の時間 |
||||||||
| Tolerance | Double |
キーの許容範囲 デフォルト値: -1
|
||||||||
| OverrideKeyLock | Boolean |
FCurveKey.Locked 値を上書きして、強制的にキーを削除します。 デフォルト値: False |
/*
This JScript example illustrates how to remove keys from an fcurve. The resample
method is used to create the initial keys then the RemoveKey method is used to
remove every other key
*/
// Create a null
Application.NewScene( "", false );
var nullobj = ActiveSceneRoot.AddNull();
// Create an fcurve on the posx parameter from the null
var fc = nullobj.posx.AddFCurve()
// Define the number of keys
var nbkeys = 100
// Create a key on each frame
fc.Resample();
// Remove every other key
var startframe = fc.GetKeyFrame(0)
var endframe = fc.GetKeyFrame( fc.GetNumKeys()-1 );
// Start editing the fcurve
fc.BeginEdit();
for ( i=startframe; i<=endframe; i+=2 )
{
fc.RemoveKey(i);
}
// End editing the fcurve and put the undo event onto
// the undo/redo stack
fc.EndEdit(); |