v5.0
フレームレート(時間)に対する F カーブの依存状態(F カーブがフレームレートに依存している場合は true)をBooleanとして設定したり、戻したりします。F カーブが時間に依存するように設定されている場合は、シーンのフレームレートの変化に従って、F カーブが調整されます。通常、F カーブが時間を係数として使用していないプロファイルカーブの場合は、F カーブが true に設定されていない方が望ましいでしょう。
アニメーションF カーブは、通常は時間に依存します。つまり、時間の経過とともにパラメータ値で変化が生じます(たとえば、フレーム 10~フレーム 90 でのオブジェクトの x 地点での変化)。プロファイルF カーブは、通常、いずれの軸においてもフレーム値をとりません。プロファイルF カーブは、ユーザがエフェクトを調整できるように、デフォーメーションで使用されます(たとえば、Bulge オペレータでは、X 軸のデフォーメーションセンタからY 軸までの振幅比率が使用されます)。
// get accessor Boolean rtn = FCurve.DependsOnFrameRate; // set accessor FCurve.DependsOnFrameRate = Boolean; |
/*
This example illustrates how to create an fcurve and set its X axis
to be time independent. That means that the FCurve will not rescale when the
scene frame rate changes
*/
// 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( 30.00, -5.00, 50.00, 5.00 );
// Create an empty FCurve
oFCurve = oPosX.AddFCurve2( null, siStandardFCurve );
// Get the current DependsOnFrameRate value
bDependsOnFrameRate = oFCurve.DependsOnFrameRate
Application.LogMessage( 'oFCurve.DependsOnFrameRate before = ' + bDependsOnFrameRate , siInfo )
// Set the fc DependsOnFrameRate to false
oFCurve.DependsOnFrameRate = false
bDependsOnFrameRate = oFCurve.DependsOnFrameRate
Application.LogMessage( 'oFCurve.DependsOnFrameRate after = ' + bDependsOnFrameRate, siInfo )
// Set the fcurve keys
oFCurve.SetKeys( aKeys );
// Validate that the key parameter does not change with the frame rate
oFCurveKey = oFCurve.Keys(0);
Application.LogMessage( 'oFCurveKey.Time before = ' + oFCurveKey.Time, siInfo );
Application.SetValue( 'PlayControl.Rate', 100 ) ;
oFCurveKey = oFCurve.Keys(0)
Application.LogMessage( 'oFCurveKey.Time after = ' + oFCurveKey.Time, siInfo );
// Produces the following output:
//
//INFO : oFCurve.DependsOnFrameRate before = true
//INFO : oFCurve.DependsOnFrameRate after = false
//INFO : oFCurveKey.Time before = 30
//INFO : oFCurveKey.Time after = 30
// Because the FCurve was set as being time independant, the
// key times are not changed when changing the frame rate
// of the scene. |