CopyAllAnimation2

Categories

animation

Description

Copies all the animation under the specified object to the clipboard. You can use the ParameterMask to specify which kinds of parameters to copy from. This saves you from having to explicitly specify the parameters to target in the InputObjs parameter.

This command usually tries to match the parameter by path. If the parameters cannot be found by path, it tries to copy them by ordinal (the order in which they are enumerated). For example, running CopyAllAnimation2 on a kine.pos would copy x-y-z on the red green blue of a shader if pasted there.

Use this command in conjunction with the PasteAllAnimation command to copy animation between objects.

Use this command instead of CopyAllAnimation.

Scripting Syntax

CopyAllAnimation2( InputObjs, [SourceMask], [ParameterMask], [RemoveAnimation], [BaseAnimation], [LayerAnimation] );

Parameters

Parameter Type Description
InputObjs Object or property name (anything selectable) The object (or property) under which we can find the animation to copy.
SourceMask siSourceType Type of animation to remove.

Currently, only FCurves and Expressions are copied.

Default Value: siAnySource

ParameterMask siParameterFilter Parameters containing animation to copy.

Default Value: siAllParam

RemoveAnimation Boolean True to disconnect the animation after copying (not supported for now)

Default Value: false

BaseAnimation Boolean If True the command will copy animation on the base layer.

Default Value: True

LayerAnimation Boolean If True the command will copy animation on all layers except the base layer.

Default Value: True

Examples

JScript Example

/*
        This example demonstrates how to copy the scaling animation with the
        CopyAllAnimation2 command and then paste it onto another object with
        the PasteAllAnimation command.
*/
NewScene( "", false );
// Create a disc and animate its scaling in X
var disc1 = CreatePrim( "Disc", "MeshSurface" );
var keys = new Array( 2, 1.4, 47, 2, 84, 0.15 );
disc1.sclx.AddFCurve2( keys );
// Create another disc onto which we will paste this animation
var disc2 = CreatePrim( "Disc", "MeshSurface" );
// Copy the animation from disc1 to disc2 (scaling parameters only)
CopyAllAnimation2( disc1, siAnySource, siScl );
PasteAllAnimation( disc2, true );
// Now delete disc1 just to prove that the animation you see is
// really on disc2, then start the playback
DeleteObj( disc1 );
PlayForwardsFromStart();
// You will see that the disc still scales up and down, even though the 
// original disc has been deleted.

See Also

PasteAllAnimation CopyAnimation PasteAnimation