List Controllers

float_list : floatController
point3_list : point3Controller
position_list : positionController
rotation_list : rotationController
scale_list : scaleController

Value > MAXWrapper > Controllers > List Controllers

 

   

Animation Controllers - Quick Navigation

Constructor

float_list ... point3_list ... position_list ... rotation_list ... scale_list ... 

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. The contribution of the single sub-controllers can be weighted allowing for animation mixing.

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.

   

Properties

.weight ArrayParameter default: #() -- float array   

An array of the weight values of the sub-controllers.

   

.average Boolean default: false -- boolean; Average_Weights 

Controls the averaging of the Weights.

   

.available 

The . available property has a controller property, which contains a "phantom" controller. To add a controller to a list controller, assign the controller to the available.controller property. The following script shows an example of creating and adding controllers to a list controller.

   

.<subcontroller>... 

The property list for a list controller also contains the sub-controllers in the list controller (if any). The type of these controllers depends on the type of the list controller. For example, a float_list can contain any number of bezier_float controllers.

EXAMPLE

=float_list ()-- create a list controller
showproperties p-- show its properties
p.available.controller-- the "phantom" controller
p1=bezier_float ()-- create a new bezier float controller
p.available.controller=p1-- add it to the list controller
p2=bezier_float ()-- create a new bezier float controller
p.available.controller=p2-- add it to the list controller
getpropnames p-- show the list controller properties
showproperties p-- show the list controller properties
p.numSubs-- the number of list controller subAnims
getsubanimnames p-- show the list controller subAnim names
p[2].object-- retrieve the second bezier float controller 

OUTPUT

Controller:Float_List-- result line 1
.weight : float array
.average (Average_Weights) : boolean
.available : float-- output line 2
false-- output line 2
Controller:-- result line 3 (the "phantom" controller)
Controller:Bezier_Float-- result line 4
Controller:Bezier_Float-- result line 5
Controller:Bezier_Float-- result line 6
Controller:Bezier_Float-- result line 7
#(#weight, #average, #bezier_float, #available)-- result line 8
.weight : float array-- output line 9
.average (Average_Weights) : boolean-- output line 9
.bezier_float : float-- output line 9
.bezier_float : float-- output line 9
.available : float-- output line 9
false-- output line 9
4-- result line 10
#(#bezier_float, #bezier_float, #available, #Weights)-- result line 11
Controller:Bezier_Float-- result line 12
OK

EXAMPLE

lst = $.pos.controller-- if this is a list controller
showInterfaces lst-- interface name is "list" 

List Controllers Interfaces:

Interface:list 

Properties

.count: integer : Read 

This property contains the number of items that appear in the List controllers list box.

   

.active: index : Read|Write 

Get/Set the the index of the currently active item.

   

Methods:

<integer>getCount () 

This method returns the number of items that appear in the List controllers list box.

   

<void>setActive <index>listIndex 

This method allows you to sets the indexed item in the list active so its parameters appear in the motion panel, and any input is directed to the indexed sub controller.

<index>listIndex: The index of the item to set as the active item.

   

<integer>getActive ()

This method returns the index of the currently active item.

   

<void>delete <index>listIndex 

This method allows you to delete the indexed sub controller from the list.

<index>listIndex: The index of the item to delete from the list.

   

<void>cut <index>listIndex 

This method allows you to cut the index sub controller from the list and stores it in the buffer to paste later.

<index>listIndex: The index of the item you wish to cut.

   

<void>paste <index>listIndex 

This method allows you to paste the sub-controller from the buffer into the indexed slot in the list.

<index>listIndex:The index of the slot to paste into.

   

<string>getName <index>listIndex 

This method returns the class name of the indexed sub-controller if a user defined name doesn’t exist.

<index>listIndex:The index of the item for which to get the name.

   

<void>setName <index>listIndex<string>name 

This method allows you to set the name of an indexed item.

<index>listIndex :The index of the item.

<string>name:The name to set it to.

See Also Class IlistControl, in the SDK Help file accompanying this product.

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 

ListCtrl Methods

The following methods were available in 3ds Max prior to version 4. They are still supported for backwards compatibility, but their functionality is covered by the new methods described above.

listCtrl.getName <list_controller> <index_integer> 

Returns the name of the indexed subcontroller in the list controller.

   

listCtrl.setName <list_controller> <index_integer> <string> 

Sets the name of the indexed subcontroller in the list controller. If the string is a null string (""), the default controller name is used.

   

listCtrl.getActive <list_controller> 

Returns the index of the active subcontroller in the list controller

   

listCtrl.setActive <list_controller> <index_integer> 

Sets the indexed subcontroller in the list controller as the active controller

   

See Also