v6.0
StartFrame およびEndFrame の間にある F カーブ上のキーを表わすFCurveKeyオブジェクトのコレクションを戻します。
oReturn = FCurve.GetKeysBetween( [StartFrame], [EndFrame] ); |
| パラメータ | タイプ | 詳細 |
|---|---|---|
| StartFrame | Variant | 範囲の開始時間。EndFrame 値よりも低い値にする必要があります。
デフォルト値:F カーブの最初のキーフレーム |
| EndFrame | Variant | 範囲の終了時間。
デフォルト値:F カーブの最後のキーフレーム |
//
// This example illustrates how to get the keys on an fcurve
// in a specific time range
// Create a new scene
NewScene(null, false);
// Create a null
oNull = Application.GetPrim("Null");
// Get the posx parameter of the null
oPosX = oNull.posx
// Create array of time-value pairs
aKeys = new Array( 0.00, 5.00,
1.00, 6.00,
2.00, 7.00,
3.00, 8.00,
4.00, 9.00,
5.00, 10.00 );
// Create an empty FCurve
oFCurve = oPosX.AddFCurve2( null, siStandardFCurve );
// Set the fcurve keys
oFCurve.SetKeys( aKeys );
var keys = oFCurve.GetKeysBetween(2.0, 4.0);
for (var i = 0; i < keys.Count; i++)
{
Application.LogMessage( 'Time: ' + keys(i).Time + ', Value: ' + keys(i).Value, siInfo );
}
// Produces the following output:
//
//INFO : Time: 2, Value: 7
//INFO : Time: 3, Value: 8
//INFO : Time: 4, Value: 9
|