v4.0
animmixer
指定のフレーム範囲において、1 つまたは複数の F カーブ アクション ソースを部分的にアンロードします。
このコマンドを実行するには、アクション ソースが外部ストレージを持つ必要があります。
アクションがダーティである場合は、アクション ソースをアンロードする前に書き出します。
オフロードまたは部分的なオフロードが実行された後は、アクション ソースがデータを再び書き出すことはありません。
アクションソースを部分的にオフロードすると、アクションソースのStatusパラメータがsiActionStatusPartiallyLoadedになります(「siAssetStatus」を参照)。
注: これは FCurve アクション
ソースのみに適用されます。
PartialOffloadAction( [InputObjs], StartFrame, EndFrame, [Remember] ); |
| パラメータ | タイプ | 詳細 |
|---|---|---|
| InputObjs | 文字列 | 処理するアクション ソースのリスト。
デフォルト値: 現在選択されている値 |
| StartFrame | Integer | F カーブのキーのオフロードを開始するフレーム。 アクションの AnimStart パラメータよりも小さい場合は、代わりに AnimStart 値が使用されます。 |
| EndFrame | Integer | F カーブのキーのオフロードを終了するフレーム。 アクションの AnimEnd パラメータよりも大きい場合は、代わりに AnimEnd 値が使用されます。 |
| Remember | ブール | True の場合は、フレームの範囲がアクションの OffloadedRanges
パラメータに適用されます。これにより、シーンを再ロードすると部分アンロードが実行されます。 False の場合は一時的に F カーブ
キーをアンロードします。
デフォルト値: False |
/*
This example shows how to partially offload an animation source.
*/
// ----------------------------------------------------------------------------------
//
// SETUP
// Create an animation source of a sphere.
NewScene( null, false );
CreatePrim( "Cone", "MeshSurface", null, null );
Translate( null, -7.85065649868519, 0.715575131336405, -7.15575131336405E-02,
siRelative, siView, siObj, siXYZ, null, null, null, null, null, null, null, null, null );
SaveKey( "cone.kine.local.posx,cone.kine.local.posy,cone.kine.local.posz", 1, null, null );
SetValue( "PlayControl.Key", 10, null );
SetValue( "PlayControl.Current", 10, null);
Translate(null, 4.19500728937374, 7.06630442194682, -0.706630442194682,
siRelative, siView, siObj, siXYZ, null, null, null, null, null, null, null, null, null );
SaveKey( "cone.kine.local.posx,cone.kine.local.posy,cone.kine.local.posz", 10, null, null );
SetValue( "PlayControl.Key", 20, null );
SetValue( "PlayControl.Current", 20, null );
Translate( null, 4.25493596493627, -7.84151081422792, 0.784151081422792,
siRelative, siView, siObj, siXYZ, null, null, null, null, null, null, null, null, null );
SaveKey( "cone.kine.local.posx,cone.kine.local.posy,cone.kine.local.posz", 20, null, null );
SetValue( "PlayControl.Key", 30, null );
SetValue( "PlayControl.Current", 30, null );
Translate( null, 4.1350786138113, 7.57317013997673, -0.757317013997673,
siRelative, siView, siObj, siXYZ, null, null, null, null, null, null, null, null, null );
SaveKey( "cone.kine.local.posx,cone.kine.local.posy,cone.kine.local.posz", 30, null, null );
SetValue( "PlayControl.Key", 40, null );
SetValue( "PlayControl.Current", 40, null );
Translate( null, 2.21736099581185, -7.48372324855972, 0.748372324855972,
siRelative, siView, siObj, siXYZ, null, null, null, null, null, null, null, null, null );
SaveKey( "cone.kine.local.posx,cone.kine.local.posy,cone.kine.local.posz", 40, null, null );
CreateModel( null, null, null );
SelectObj( "Model.Cone", null, null );
StoreAction( "", "Model.Cone.kine.local.sclx,Model.Cone.kine.local.scly,"
+ "Model.Cone.kine.local.sclz,Model.Cone.kine.local.rotx,Model.Cone.kine.local.roty,"
+ "Model.Cone.kine.local.rotz,Model.Cone.kine.local.posx,Model.Cone.kine.local.posy,"
+ "Model.Cone.kine.local.posz,Model.Cone.kine.global.sclx,Model.Cone.kine.global.scly,"
+ "Model.Cone.kine.global.sclz,Model.Cone.kine.global.rotx,Model.Cone.kine.global.roty,"
+ "Model.Cone.kine.global.rotz,Model.Cone.kine.global.posx,Model.Cone.kine.global.posy,"
+ "Model.Cone.kine.global.posz", 2, "simplemove", true, 1, 40, false, false );
// Add a clip of the source in the mixer
SelectObj( "Model", null, null );
AddTrack( "Model", "Model", 0, null, null );
AddClip( "Model", "Sources.Animation.Model.simplemove", null, "Model.Mixer.Mixer_Anim_Track",
1, null, null, null, null );
SetValue( "PlayControl.Key", 20, null );
SetValue( "PlayControl.Current", 20, null );
// We need to set the external storage to external if we want to be able to offload the source
SetValue( "Sources.Animation.Model.simplemove.storage", 3, null );
var oAction = GetValue( "Sources.Animation.Model.simplemove" );
// ----------------------------------------------------------------------------------
//
// OFFLOAD
// Note that this partial offload has not been added to the OffloadedRanges parameter
// of the source.
PartialOffloadAction( "Sources.Animation.Model.simplemove", 10, 20, false );
Application.LogMessage ( FindActionStatus(oAction.status.Value) );
Application.LogMessage ( oAction.OffloadedRanges.Value );
// ----------------------------------------------------------------------------------
//
// RELOAD
// Reloading the action will dispose the temporary offloaded ranges
oAction.Reload();
PartialOffloadAction( "Sources.Animation.Model.simplemove", 12, 22, true );
Application.LogMessage ( FindActionStatus(oAction.status.Value) );
Application.LogMessage ( oAction.OffloadedRanges.Value );
// ----------------------------------------------------------------------------------
//
// OUTPUT
//INFO : The action source contains section that are offloaded.
//INFO :
//INFO : The action source contains section that are offloaded.
//INFO : 12,22
// ----------------------------------------------------------------------------------
//
// HELPER
function FindActionStatus( in_Val )
{
var results = "";
switch ( in_Val ) {
case siActionStatusOffloaded :
results = "The action source is offloaded on disk.";
break;
case siActionStatusPartiallyLoaded :
results = "The action source contains section that are offloaded.";
break;
case siActionStatusLoaded :
results = "The action source is loaded.";
break;
default :
results = "Unrecognized action status.";
}
return results;
}
|