FCurve.InsertKeyAtFrame

導入

v7.5

詳細

現在の時間またはフレーム引数によって指定した時間にキーを挿入します。FCurve.AddKey と異なり、このメソッドを実行しても、F カーブのシェイプは変わりません。

C#構文

Boolean FCurve.InsertKeyAtFrame( Object in_Frame );

スクリプト構文

oBoolean = FCurve.InsertKeyAtFrame( [Frame] );

戻り値

BooleanFCurveKeyが正常に追加された場合は true)

パラメータ

パラメータ タイプ 説明
Frame Variant キーの時間(フレーム)

デフォルト値:現在の時間

JScript の例

/*

	This example illustrates how to insert keys in an fcurve.

*/

// Create a cube 

NewScene(null, false);

CreatePrim("Cube", "MeshSurface");

// Create an fcurve on the posx parameter of the cube

SaveKey("cube.kine.local.posx", 1, 0);

SaveKey("cube.kine.local.posx", 30, 5);

// Insert a key at frame 10

var fc = Application.Selection(0).posx.Source;

var bIsKeyInsertedAtFrame10 = fc.InsertKeyAtFrame(10);

Application.LogMessage("Key inserted at frame 10 = " + bIsKeyInsertedAtFrame10);

// Move to the frame 20

SetValue("PlayControl.Key", 20);

SetValue("PlayControl.Current", 20);

// Insert a key at the current frame

fc = Application.Selection(0).posx.Source;

var bIsKeyInsertedAtCurrentFrame = fc.InsertKeyAtFrame();

Application.LogMessage("Key inserted at current frame (frame 20) = " + bIsKeyInsertedAtCurrentFrame);

// Open the Animation Editor

SelectObj("cube", null, true);

OpenView("Animation Editor");

// Outputs:

//INFO : Key inserted at frame 10 = true

//INFO : Key inserted at current frame (frame 20) = true

関連項目

FCurve.AddKey