FCurve.RemoveKeys

導入

v3.0

詳細

StartFrame と EndFrame の間にあるすべてのキーを削除し、削除されたキーの数を戻します。

注:F カーブがロックされている場合は、'Access Denied'(E_ACCESSDENIED)エラーが発生します。キーロックは、OverrideKeyLock 引数を使用して上書きできます。

C#構文

Int32 FCurve.RemoveKeys( Object in_StartFrame, Object in_EndFrame, Boolean in_OverrideKeyLock );

スクリプト構文

oLong = FCurve.RemoveKeys( [StartFrame], [EndFrame], [OverrideKeyLock] );

戻り値

Long

パラメータ

パラメータ タイプ 説明
StartFrame Variant キーの削除を開始する時間(フレーム)

デフォルト値:ファンクションカーブの最初のキーのフレーム

EndFrame Variant 再サンプリングを終了する時間(フレーム)

デフォルト値:ファンクションカーブの最後のキーのフレーム

OverrideKeyLock Boolean FCurveKey.Locked 値を上書きして、強制的にキーを削除します。

デフォルト値: false

JScript の例

/*

	This JScript example illustrates how to use the FCurve.RemoveKeys method

	to remove keys from the entire curve or from an interval on the fcurve.

*/

// Create a null

Application.NewScene( null, false );

var nullobj = ActiveSceneRoot.AddNull();

var empty;

// Create a custom property set on the null

var cpset = nullobj.AddCustomProperty( "CustomPSet" );

var x = cpset.AddParameter( "X", siDouble, empty, siAnimatable, "X", "X", empty, 0.25, 0, 10 );

var y = cpset.AddParameter( "Y", siInt4, empty, siAnimatable, "Y", "Y", empty, 5, 0, 100 );

var z = cpset.AddParameter( "Z", siBool, empty, siAnimatable, "Z", "Z", empty, true );

// Create some fcurves

var fc1 = x.AddFCurve();

var fc2 = y.AddFCurve();

var fc3 = z.AddFCurve();

// Add keys to the fcurves

fc1.Resample();

fc2.Resample();

fc3.Resample();

// Lock all the keys on fc3

for ( i=0; i<fc3.GetNumKeys(); i++ )

{

	key = fc3.GetKeyAtIndex(i);

	key.Locked = true;

}

var cKeys;

// Remove all keys between frame 1 and 10 and override the key lock

LogMessage( "keys in interval 1-10 : " +  fc3.GetNumKeys(1,10) );

cKeys = fc3.RemoveKeys( 1, 10, true );

LogMessage( "keys removed " + cKeys );

// Remove all the keys from fc1

LogMessage( "total num keys : " +  fc3.GetNumKeys() );

cKeys = fc1.RemoveKeys();

LogMessage( "keys removed " + cKeys );

// Remove all keys between frame 10 and 20

LogMessage( "keys in interval 10-20 : " +  fc3.GetNumKeys(10,20) );

cKeys = fc2.RemoveKeys( 10, 20 );

LogMessage( "keys removed " + cKeys );

// Outputs:

//INFO : "keys in interval 1-10 : 10"

//INFO : "keys removed 10"

//INFO : "total num keys : 90"

//INFO : "keys removed 100"

//INFO : "keys in interval 10-20 : 10"

//INFO : "keys removed 11"

関連項目

FCurve.Locked FCurve.RemoveKey FCurve.RemoveKeyAtIndex FCurve.RemoveKeysAtIndex