List Controller

Topic: version 4 MAXScript Language Improvements/ Controllers

The List controller combines multiple controllers into a single effect. It is a compound controller with tools for managing the order in which its internal controllers are calculated. Controllers are evaluated in a top to bottom order; the controller at the top of the list is evaluated first.

When you assign a List controller to a parameter, the current controller is moved one level below the List controller; it becomes the first controller in the list. A second parameter is added below the List controller and is named Available. This is an empty placeholder for the next controller you add to the list.

ListCtrl const StructDef

Example:

lst = $.pos.controller -- if this is a list controller

showInterfaces lst           -- interface name is "list"

Methods

lst.getCount()           

Returns the count function.

lst.count

Returns count property (read only).

lst.SetActive <index>

Set active function

lst.GetActive()

Get active function

lst.active

Get/set active property.

lst.cut <index>

Cut the indexed sub-controller

lst.paste <index>

Paste clip to index location.

lst.delete <index>      

Delete the indexed sub-controller.

lst.setName <index> <string>   

Sets the name of the indexed sub-controller.

lst.getName <index>

Gets the name of the indexed sub-controller.

Example:

b = Box lengthsegs:1 widthsegs:1 heightsegs:1 length:65.7611 width:32.0211 height:39.8261 pos:[-15.6972,-84.9615,0] isSelected:on

b.pos.controller = position_list ()

b.pos.controller.Available.controller = Position_XYZ ()

b.pos.controller.Available.controller = tcb_position ()

b.pos.controller.Available.controller = bezier_position ()

lst = b.pos.controller  -- the list controller

showInterfaces lst -- interface name is "list"

lst.getCount() -- count function

lst.count -- count property (read only)

lst.SetActive 3         -- set active function

lst.GetActive() -- get active function

lst.active -- active property

lst.cut 2 -- cut the second sub-controller

lst.paste 1 -- paste it to the top of the list

lst.delete lst.count -- delete the second to last sub-controller

lst.setName 2 "My Bezier" -- sets the name of the second sub-controller

lst.getName 2 -- gets the name of the sub-controller

See also