v7.5
現在の時間またはフレーム引数によって指定した時間にキーを挿入します。FCurve.AddKey と異なり、このメソッドを実行しても、F カーブのシェイプは変わりません。
Boolean FCurve.InsertKeyAtFrame( Object in_Frame ); |
oBoolean = FCurve.InsertKeyAtFrame( [Frame] ); |
| パラメータ | タイプ | 説明 |
|---|---|---|
| Frame | Variant |
キーの時間(フレーム) デフォルト値:現在の時間 |
/*
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 |