OffloadAction
 
 
 

OffloadAction

Introduced

v4.0

Description

Offloads one or many action sources. Offloading action source allows you to manage large scenes as it will disconnect heavy sources like those that contain motion capture fcurves from clips in the scene. You can reload (reconnect) the sources at a later time (see ReloadAction).

This command saves the source to disk and removes all animation source items (like fcurves and target objects), but it won't delete the action source. All animation clips that use this action source will still exist but they will be disconnected. When reloading the action source, all clips are reconnected.

The source storage must be set to external and the file must be valid. Animation sources with internal storage cannot be offloaded. If the animation source has changed in any way, it is saved before offloading.

Scripting Syntax

OffloadAction( [InputObjs] );

Parameters

Parameter Type Description
InputObjs String List of action sources to process.

Default Value: Current selection

Examples

JScript Example

// JScript example that shows how to offload and reload an animation source.
NewScene( null, false );
// ----------------------------------------------------------------------------------
// SETUP
// Create an animation source on a sphere.
CreatePrim( "Sphere", "MeshSurface", null, null );
Translate( null, -6.70417330973736, 0.299143577255684, -2.99143577255684E-02, 
        siRelative, siView, siObj, siXYZ, null, null, null, null, null, null, null, null, null );
SaveKey( "sphere.kine.local.posx,sphere.kine.local.posy,sphere.kine.local.posz", 1, null, null );
SetValue( "PlayControl.Key", 40, null );
SetValue( "PlayControl.Current", 40, null );
Translate( null, 15.6330498702397, 0.32905793498125, -3.29057934981251E-02, 
        siRelative, siView, siObj, siXYZ, null, null, null, null, null, null, null, null, null );
SaveKey( "sphere.kine.local.posx,sphere.kine.local.posy,sphere.kine.local.posz", 40, null, null );
CreateModel( null, null, null );
SelectObj( "Model.sphere", null, null );
StoreAction( "", "Model.sphere.kine.local.sclx,Model.sphere.kine.local.scly, Model.sphere.kine.local.sclz,Model.sphere.kine.local.rotx,Model.sphere.kine.local.roty, Model.sphere.kine.local.rotz,Model.sphere.kine.local.posx,Model.sphere.kine.local.posy, Model.sphere.kine.local.posz,Model.sphere.kine.global.sclx,Model.sphere.kine.global.scly, Model.sphere.kine.global.sclz,Model.sphere.kine.global.rotx,Model.sphere.kine.global.roty, Model.sphere.kine.global.rotz,Model.sphere.kine.global.posx,Model.sphere.kine.global.posy, Model.sphere.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 );
// ----------------------------------------------------------------------------------
// OFFLOAD
// Now offload the source
OffloadAction( "Sources.Animation.Model.simplemove" );
// The clip in the mixer is now gray and has no more effect on the sphere.
SetValue("PlayControl.Key", 10, null);
SetValue("PlayControl.Current", 10, null);
// ----------------------------------------------------------------------------------
// RELOAD
// Finally, reload the source and reconnect the clip.:
ReloadAction("Sources.Animation.Model.simplemove");

See Also

ReloadAction PartialOffloadAction ActionSource.Offload