v7.5
アニメーションの連続したフレームからの値をプロットすることにより、アクションを作成して戻します。 アクションは、指定されたリストと一致するアニメートされたパラメータを含むモデルの下に作成されます。アクションを元のモデルに適応するかどうか(およびオプションでそれらを削除するかどうか)は、選択することができます。
oReturn = PlotAndApplyActions( [InputObj], [Name], [StartFrame], [EndFrame], [StepFrame], [FCurve Kind], [DefaultSegKind], [Fit FCurve], [Fit Tolerance], [ProcessContRots], [Apply], [Paste], [Delete], [Type], FrameSet ); |
新しく作成されたアクション(XSICollection オブジェクト)を戻します。 Delete オプションを選択すると、何も戻されません。
| パラメータ | タイプ | 説明 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| InputObj | 文字列 |
アクションにプロットするパラメータのリスト
デフォルト値:現在の選択対象にマーキングされている値 |
||||||||||
| Name | 文字列 |
アクションの名前 デフォルト値: Action |
||||||||||
| StartFrame | Double |
最初にプロットするフレーム デフォルト値: 0 |
||||||||||
| EndFrame | Double |
最後にプロットするフレーム デフォルト値: 0 |
||||||||||
| StepFrame | Double |
フレーム間のステップ デフォルト値: 1 |
||||||||||
| FCurve Kind | Integer |
プロットしたい F カーブの種類 デフォルト値: 20
|
||||||||||
| DefaultSegKind | Integer |
出力の F カーブに適用する補間の種類 注: FCurveKind が 20(標準)の場合にのみ影響します。 デフォルト値: 3
|
||||||||||
| Fit FCurve | Boolean |
プロット値を通して F カーブを合わせるかどうかを指定します。 デフォルト値: False |
||||||||||
| Fit Tolerance | Double |
実装のための許容値 デフォルト値: 0.01 |
||||||||||
| ProcessContRots | Boolean |
連続性が保たれるように回転カーブを処理するかどうかを指定します。 デフォルト値: True |
||||||||||
| Apply | Boolean |
アクションのプロット後に、それらのアクションを適用するかどうかを指定します。 デフォルト値: True |
||||||||||
| Paste | Boolean |
適用する場合は、paste を使用して適用するかどうかを指定します(パラメータの既存の F カーブとマージするかどうかを指定します)。 デフォルト値: False |
||||||||||
| Delete | Boolean |
プロットして適用した後に、アクションを削除するかどうかを指定します。 Apply を True に指定した場合にのみ有効です。 デフォルト値: False |
||||||||||
| Type | Integer |
フレーム範囲の場合は 0、フレーム セットの場合は 1。 デフォルト値: 1 |
||||||||||
| FrameSet | Array | 各フレームをプロットするシーン時間(秒単位)の配列。 |
//
// This example sets up one model with a sphere and another with a cone,
// plots various parameters to an action source for each model,
// and then prints out the new sources.
//
// Set up the scene.
NewScene( null, false );
var oSphere = CreatePrim( "Sphere", "NurbsSurface", "MySphere" );
var oCone = CreatePrim( "Cone", "NurbsSurface", "MyCone" );
CreateModel( oSphere, "SphereModel" );
CreateModel( oCone, "ConeModel" );
// Set some keys at frames 1 and 100 with it moving diagonally.
Translate( oSphere, -6, 3, 0, siAbsolute, siView, siObj, siXYZ );
SaveKey( oSphere + "/kine.local.pos", 1 );
Translate( oSphere , 6, -3, 0, siAbsolute, siView, siObj, siXYZ );
SaveKey( oSphere + "/kine.local.pos", 100 );
Translate( oCone , 6, -3, 0, siAbsolute, siView, siObj, siXYZ );
SaveKey( oCone + "/kine.local.pos", 1 );
Translate( oCone , -6, 3, 0, siAbsolute, siView, siObj, siXYZ );
SaveKey( oCone + "/kine.local.pos", 100 );
// Plot the positions of the sphere and the Y position of the cone every two frames
// between frames 40 and 60 and store the result in a standard fcurve with cubic
// interpolation. Don't fit the fcurves and don't care about continuous rotations
// since we're plotting positions. After plotting to actions, apply the plotted
// animations back onto the sphere and the cone using "paste" so existing keys outside
// the plot range are not affected. Don't delete the actions after applying them.
var oParamsColl = new ActiveXObject( "XSI.Collection" );
oParamsColl.Add( oSphere + ".kine.local.posx" );
oParamsColl.Add( oSphere + ".kine.local.posy" );
oParamsColl.Add( oSphere + ".kine.local.posz" );
oParamsColl.Add( oCone + ".kine.local.posx" );
var oActionsColl = PlotAndApplyActions( oParamsColl.GetAsText(),
"plot", 40, 60, 2, 20, 3, false, null, null, true, true, false );
var iActionsCount = oActionsColl.Count;
if( iActionsCount > 0 )
{
for( var i = 0; i < iActionsCount; i++ )
{
var oAction = oActionsColl.Item( i );
var oSourceItemsFound = oAction.SourceItems;
var iSourceItemsCount = oSourceItemsFound.Count;
if( iSourceItemsCount > 0 )
{
Application.LogMessage( "Found the following source items in " + oAction + ":" );
for( var j = 0; j < iSourceItemsCount; j++ )
{
Application.LogMessage( "\t" + oSourceItemsFound.Item( j ).Name );
}
}
else
{
Application.LogMessage( "No source items found in " + oAction + "." );
}
}
}
else
{
Application.LogMessage( "No actions created." );
}
//---------------------------------------------------------
// OUTPUT OF ABOVE SCRIPT IS:
// INFO : Found the following source items in Sources.SphereModel.plot:
// INFO : MySphere.kine.local.posx
// INFO : MySphere.kine.local.posy
// INFO : MySphere.kine.local.posz
// INFO : Found the following source items in Sources.ConeModel.plot:
// INFO : MyCone.kine.local.posx
//--------------------------------------------------------- |