## DuplicateAnimationLayer

### Introduced

v6.0

### Description

Duplicates and mutes the specified animation layer and make the duplicated layer the current animation layer.
Note: A value of 0 for the layer will be ignored because the base animation cannot be removed with this command.

### Scripting Syntax

    DuplicateAnimationLayer( [InputObjs], [Layer] );

### Parameters

Parameter | Type | Description
--- | --- | ---
InputObjs | String | List of objects. Default Value: Currently selected objects
Layer | Long | Animation layer to remove. Only layers greater than 0 can be removed. Default Value: Current animation layer (-1)

### Examples

#### VBScript Example

    '

    ' In this example, an FCurve is created on the XPos param

    ' of the sphere. Then, two keys are created (at frame 1,

    ' XPos = -2; at frame 30, XPos = 5). A layer is then added

    ' and duplicated.

    '

    NewScene

    CreatePrim "Sphere", "NurbsSurface", "MySphere"

    ' Add a posx fcurve

    AddFCurve "MySphere.kine.local.posx"

    ' Add two keys, at frame 1 and 30

    SaveKey "MySphere.kine.local.posx", 1, -2

    SaveKey "MySphere.kine.local.posx", 30, 5

    ' Create a new animation layer and make it current

    AddAnimationLayer

    ' Add layer key, at frame 1 and 30

    SaveKey "MySphere.kine.local.posx", 1, 0

    ' Duplicate animation layer

    DuplicateAnimationLayer

    ' Add layer key at frame 30 on new layer

    SaveKey "MySphere.kine.local.posx", 30, 3

    ' Play the animation

    PlayForwardsFromStart

### See Also

SetCurrentAnimationLayer GetCurrentAnimationLayer GetNumberOfAnimationLayers AddAnimationLayer DeleteAnimationLayer DuplicateAnimationLayer RemoveAnimation RemoveAllAnimation SaveKey RemoveKey PrevKey FirstKey LastKey Parameter.AddFCurve