v6.0
F カーブを拡張して、前後のサイクルの指定した数が含まれるようにします。
サイクルの長さは開始/終了キーによって定義され、F カーブ(FCurve.Extrapolation)の現在の補間は新しいサイクルが生成されるときに考慮されます。そのため、F カーブに 2 つのキーがない場合は、このメソッドは失敗します。
FCurve.ExtendCycle( Int32 in_CyclesBefore, Int32 in_CyclesAfter ); |
FCurve.ExtendCycle( [CyclesBefore], [CyclesAfter] ); |
| パラメータ | タイプ | 説明 |
|---|---|---|
| CyclesBefore | Long |
F カーブの前に拡張するサイクルの数 デフォルト値: 0 |
| CyclesAfter | Long |
F カーブの後ろに拡張するサイクルの数 デフォルト値: 0 |
//
// This example illustrates how to extend an fcurve to include cycles before/after
// 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 );
// Set the extrapolation for this fcurve
oFCurve.Extrapolation = siPeriodicRelativeExtrapolation;
Application.LogMessage( 'Before ExtendCycle:', siInfo );
for (var i = 0; i < oFCurve.Keys.Count; i++)
{
Application.LogMessage( 'Time: ' + oFCurve.Keys(i).Time + ', Value: ' + oFCurve.Keys(i).Value, siInfo );
}
// Extend one cycle before and after
oFCurve.ExtendCycle( 1, 1 );
Application.LogMessage( 'After ExtendCycle:', siInfo );
for (var i = 0; i < oFCurve.Keys.Count; i++)
{
Application.LogMessage( 'Time: ' + oFCurve.Keys(i).Time + ', Value: ' + oFCurve.Keys(i).Value, siInfo );
}
// Produces the following output:
//
//INFO : Before ExtendCycle:
//INFO : Time: 0, Value: 5
//INFO : Time: 1, Value: 6
//INFO : Time: 2, Value: 7
//INFO : Time: 3, Value: 8
//INFO : Time: 4, Value: 9
//INFO : Time: 5, Value: 10
//INFO : After ExtendCycle:
//INFO : Time: -5, Value: 0
//INFO : Time: -4, Value: 1
//INFO : Time: -3, Value: 2
//INFO : Time: -2, Value: 3
//INFO : Time: -1, Value: 4
//INFO : Time: 0, Value: 5
//INFO : Time: 1, Value: 6
//INFO : Time: 2, Value: 7
//INFO : Time: 3, Value: 8
//INFO : Time: 4, Value: 9
//INFO : Time: 5, Value: 10
//INFO : Time: 6, Value: 11
//INFO : Time: 7, Value: 12
//INFO : Time: 8, Value: 13
//INFO : Time: 9, Value: 14
//INFO : Time: 10, Value: 15 |