The LayerInterface is exposed by all Animation Layer Controllers.
Available in 3ds Max 9 and higher.
Layer interfaces
Interface:layerProperties
<LayerController>.count : integer : ReadGet the number of layers in the controller.
<LayerController>.active : index : Read|WriteGet/Set the index of the active layer.
Methods
<integer><LayerController>.getCount()Returns the number of layers in the controller.
<void><LayerController>.setLayerActive <index>listIndexlistIndex Validated by Validator function
Activates the indexed layer.
<index><LayerController>.getLayerActive()Returns the index of the current layer.
<void><LayerController>.copyLayer <index>listIndexlistIndex Validated by Validator function
Copies the indexed layer into the clipboard.
<void><LayerController>.pasteLayer <index>listIndexlistIndex Validated by Validator function
Pastes the indexed layer from the clipboard.
<void><LayerController>.deleteLayer <index>listIndexlistIndex Validated by Validator function
Deletes the indexed layer.
<string><LayerController>.getLayerName <index>listIndexlistIndex Validated by Validator function
Returns the name of the indexed layer.
<void><LayerController>.setLayerName <index>listIndex <string>namelistIndex Validated by Validator function
Sets the name of the indexed layer to the given string.
<control><LayerController>.getSubCtrl <index>indexindex Validated by Validator function
Returns the indexed sub-controller.
<float><LayerController>.getLayerWeight <index>index <time>atTimeindex Validated by Validator function
Returns the weigth of the indexed layer at the given time.
<void><LayerController>.setLayerWeight <index>listIndex <time>atTime <float>weightlistIndex Validated by Validator function
Sets the weigth of the indexed layer at the given time to the specified float value.
<boolean><LayerController>.getLayerMute <index>indexindex Validated by Validator function
Returns true if the indexed layer is muted, false otherwise.
<void><LayerController>.setLayerMute <index>listIndex <boolean>mutelistIndex Validated by Validator function
Sets the muted state of the indexed layer to the given boolean value.
<void><LayerController>.collapseLayer <index>listIndexlistIndex Validated by Validator function
Collapses the indexed layer.
<void><LayerController>.disableLayer ()Disables layers by removing all layer information from the track.
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