v7.5
アニメーションの連続したフレームからの値をプロットすることにより、アクションを作成して戻します。 アクションは、指定されたリストと一致するアニメートされたパラメータを含むモデルの下に作成されます。
oReturn = PlotToActions( [InputObj], [Name], [StartFrame], [EndFrame], [StepFrame], [FCurve Kind], [DefaultSegKind], [Fit FCurve], [Fit Tolerance], [ProcessContRots] ); |
新しく作成されたアクション(XSICollection オブジェクト)を戻します。
| パラメータ | タイプ | 説明 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 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 |
//
// This example sets up one model with a sphere and another with a cone,
// marks the local posz parameter of each primitive, 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" );
// Create a path for the sphere and cone, just to make things more interesting.
var oPath = CreatePrim( "Spiral", "NurbsCurve" );
ApplyPath( oSphere, oPath, 1, 50, 2, true, true );
ApplyPath( oCone, oPath, 50, 100, 2, true, true );
// Mark the local position parameter in Z for the sphere and cone.
SelectObj( oSphere + "," + oCone, null, true );
SetMarking( "kine.local.posz" );
// Plot the values of the marked parameter for the sphere and cone between frames 20 and 60.
// Notice that the default input is the marked parameters, so
// we do not have to specify anything for the 1st argument
PlotToActions( null, null, 20, 60 );
// Plot the local X position of the sphere and cone every frame between frames 20 and 60
// and store the result in raw data fcurves.
PlotToActions( oSphere + ".kine.local.posx," + oCone + ".kine.local.posx",
"ActionPosX", 20, 60, 1, 30 );
// Plot the local Y position of the sphere only every frame between frames 20 and 60
// and store the result in a standard fcurve with constant interpolation after
// applying a fit with a tolerance of 0.1 to the plotted values.
PlotToActions( oSphere.posy, "ActionPosY", 20, 60, 1, 30, 1, true, 0.1, true );
// Once they are created, they are stored with the scene waiting to be applied
var oRoot = Application.ActiveSceneRoot;
var oModelsFound = oRoot.Models;
var iModelsCount = oModelsFound.Count;
if( iModelsCount > 0 )
{
for( var i = 0; i < iModelsCount; i++ )
{
var oModel = oModelsFound.Item( i );
var oSourcesFound = oModel.Sources;
var iSourcesCount = oSourcesFound.Count;
if( iSourcesCount > 0 )
{
Application.LogMessage( "Found the following sources in " + oModel + ":" );
for( var j = 0; j < iSourcesCount; j++ )
{
Application.LogMessage( "\t" + oSourcesFound.Item( j ).Name );
}
}
else
{
Application.LogMessage( "No sources found in " + oModel + "." );
}
}
}
else
{
Application.LogMessage( "No models found in the scene." );
}
//---------------------------------------------------------
// OUTPUT OF ABOVE SCRIPT IS:
// INFO : Found the following sources in SphereModel:
// INFO : Action
// INFO : ActionPosX
// INFO : ActionPosY
// INFO : Found the following sources in ConeModel:
// INFO : Action
// INFO : ActionPosX
//--------------------------------------------------------- |