FCurveKeyCollection.GetMidKeyFrame

導入

v6.0

詳細

F カーブキーコレクションの最小および最大キー時間の平均(フレーム単位)を戻します。

C#構文

Double FCurveKeyCollection.GetMidKeyFrame();

スクリプト構文

oDouble = FCurveKeyCollection.GetMidKeyFrame();

戻り値

Double

JScript の例

// 

// This example illustrates how to get the mid frame time for an fcurvekey collection.

// 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 );

Application.LogMessage( 'Mid key time: ' + oFCurve.GetKeysBetween(2,4).GetMidKeyFrame(), siInfo );

// Produces the following output:

//

//INFO : Mid key time: 3

関連項目

FCurveKeyCollection.GetMinKeyFrame FCurveKeyCollection.GetMaxKeyFrame FCurve.GetMidKeyFrame