Layer Controller Interfaces

The LayerInterface is exposed by all Animation Layer Controllers.

Available in 3ds Max 9 and higher.

Layer interfaces

Interface:layer

Properties

<LayerController>.count : integer : Read

Get the number of layers in the controller.

<LayerController>.active : index : Read|Write

Get/Set the index of the active layer.

Methods

<integer><LayerController>.getCount()

Returns the number of layers in the controller.

<void><LayerController>.setLayerActive <index>listIndex

listIndex Validated by Validator function

Activates the indexed layer.

<index><LayerController>.getLayerActive()

Returns the index of the current layer.

<void><LayerController>.copyLayer <index>listIndex

listIndex Validated by Validator function

Copies the indexed layer into the clipboard.

<void><LayerController>.pasteLayer <index>listIndex

listIndex Validated by Validator function

Pastes the indexed layer from the clipboard.

<void><LayerController>.deleteLayer <index>listIndex

listIndex Validated by Validator function

Deletes the indexed layer.

<string><LayerController>.getLayerName <index>listIndex

listIndex Validated by Validator function

Returns the name of the indexed layer.

<void><LayerController>.setLayerName <index>listIndex <string>name

listIndex Validated by Validator function

Sets the name of the indexed layer to the given string.

<control><LayerController>.getSubCtrl <index>index

index Validated by Validator function

Returns the indexed sub-controller.

<float><LayerController>.getLayerWeight <index>index <time>atTime

index Validated by Validator function

Returns the weigth of the indexed layer at the given time.

<void><LayerController>.setLayerWeight <index>listIndex <time>atTime <float>weight

listIndex Validated by Validator function

Sets the weigth of the indexed layer at the given time to the specified float value.

<boolean><LayerController>.getLayerMute <index>index

index Validated by Validator function

Returns true if the indexed layer is muted, false otherwise.

<void><LayerController>.setLayerMute <index>listIndex <boolean>mute

listIndex Validated by Validator function

Sets the muted state of the indexed layer to the given boolean value.

<void><LayerController>.collapseLayer <index>listIndex

listIndex Validated by Validator function

Collapses the indexed layer.

<void><LayerController>.disableLayer ()

Disables layers by removing all layer information from the track.

Example

This example iterates through all the Animation Layers for the selected object, printing their name. It then makes the last layer active.

s = $
ctls = s.position.controller
for i = 1 to ctls.count do
    print ctls[i].name
-- set last layer active:
ctls.setLayerActive ctls.count