MaxScript with Layers
 
 
 

LayerRoot

The CATParent holds a controller called the LayerRoot, which manages all the layers in the character. The LayerRoot holds a table of LayerInfo controllers, which hold information relevant to each layer, such as the layer name, global weight, and timewarp curve.

LayerRootFPInterface

This interface exposes all the layer manipulations to MAXScript, and is available on every layer controller, the CATParent, and the layer root controller. Many controllers expose the LayerRootFPInterface, and function calls made to a LayerRootInterface are passed directly on to the LayerRoot controller. The LayerRootFPInterface is exposed on multiple controllers in the character hierarchy simply for the convenience of the scripter.

Properties:

 .NumLayers : integer : Read

The number of layers currently in the layer stack on this character

 .SelectedLayer : integer : Read|Write

If a layer is currently selected, then this returns its index, or -1 if no layer is soloed

 .SoloLayer : integer : Read|Write

If a layer is currently soloed, then this returns its index, or -1 if no layer is soloed

 .TrackDisplayMethod : integer : Read|Write

Returns the setting for Track display. This crrelates to the setting on the CATParent Rollout

Methods:

 <integer>AppendLayer <TSTR>name <name>method method Validated by Validator function

Add a new layer to the end of the layer stack.

Example: $CATParent.AppendLayer NewLayerName #absolute

 <boolean>InsertLayer <TSTR>name <integer>layerID <name>method       method Validated by Validator function

Insert a layer into the layer stack at the specified position

 <void>RemoveLayer <integer>layerID

Remove the specified layer.

 <void>MoveLayerUp <integer>layerID

Move the specified layer up one position in the layer stack.

 <void>MoveLayerDown <integer>layerID

Move the specified layer down position in the layer stack.

 <boolean>SaveClip <TSTR>filename <time>starttime <time>endtime <integer>startlayer <integer>endlayer

Save a Clip file to the hard drive.

Example: $CATParent.SaveClip c:\backflip.clp 20 130 2 3

 <boolean>SavePose <TSTR>filename

Save a pose file to the hard drive.

Example: $CATParent.layers.controller.SavePose c:\point.pse

 <node>LoadClip <TSTR>filename <time>starttime scaledata:<boolean> transformdata:<boolean> mirrordata:<boolean> mirrorworldX:<boolean> mirrorworldY:<boolean>       scaledata default value: true       transformdata default value: true mirrordata default value: false       mirrorworldX default value: false       mirrorworldY default value: false

Load a Clip file from the hard drive.

 <node>LoadPose <TSTR>filename <time>starttime scaledata:<boolean> transformdata:<boolean> mirrordata:<boolean> mirrorworldX:<boolean> mirrorworldY:<boolean>       scaledata default value: true       transformdata default value: true mirrordata default value: false       mirrorworldX default value: false       mirrorworldY default value: false

Load a Pose file from the hard drive.

 <TSTR>GetFileTagValue <TSTR>filename <TSTR>tag

Given a Clip or Pose file, return a value of a specified tag in the file.

 <boolean>LoadHTR <TSTR>filename <TSTR>camfile
 <boolean>LoadBVH <TSTR>filename <TSTR>camfile
 <boolean>LoadFBX <TSTR>filename <TSTR>camfile
 <boolean>LoadBIP <TSTR>filename <TSTR>camfile
 <void>CollapsePoseToCurLayer()

Take the result of the layer stack and bake it into a layer.

 <boolean>CollapseTimeRangeToLayer <time>StartTime <time>Endtime <time>Frequency quiet:<boolean>       quiet default value: true

Collapse the current layer stack down to one new layer.

 <void>CopyLayer <index>LayerID

Copy the Current later ready to Paste it.

 <void>PasteLayer Instance:<boolean> CopyLayerInfo:<boolean> Instance default value: false       CopyLayerInfo default value: true

Paste the copied layer onto this layer stack

LayerInfo

The LayerRoot holds a table of LayerInfo controllers. Each LayerInfo controller holds the properties for a layer in the layer stack.

SubAnims

 .weights : float

The weights subanim found on the LayerInfo controller is global weights controller for this layer.

 .timewarp : float

Access to the layer time warp controller.

 .transform : transform

The transform controller for the Transform node.

To display the Interfaces for the LayerInfo controller, use the following line of maxscript.

 ShowInterfaces $<catparent>.layers.controller[1].controller

LayerInfoFPInterface

Properties:

 .LayerName : TSTR by value : Read|Write

The name of the layer as it appears in the LayerManager rollout.

 .LayerColour : color by value : Read|Write

The color of the layer. This is the colour that is used to colour the CATRig when Colour Modes is set to 'Layer Colours'

 .LayerType : TSTR by value : Read

Use this to find out what type of layer this LayerInfo controller is maintaining.

Example:"Absolute"

 .LayerEnabled : boolean : Read|Write

This value enables or disables the layer.

 .TransformNodeOn : boolean : Read|Write

An Setting allowing you to turn the transform node on and of, or to check the current state of the transfomr node button.

 .LayerIndex : index : Read

The index of this layer in the Layer stack. An index of 1 means that it is at the very top of the layer stack.

 .CATParent : node : Read

Access to the CATParent node.

Methods:

 <node>GetTransformNode()

Returns the INode for the transform node if it is currently created.