MAXKeyArray Values

Value > Collections > Collection Types > MAXKeyArray Values

 

   

Values and Collections - Quick Navigation

A MAXKeyArray represents all the keyframe keys in a 3ds Max controller track.

See also MAXKey Values, Working with MAXKey Values, and Controller Common Properties, Operators, and Methods.

MAXKeyArray values are mappable.

   

Constructors

<node>.<animatable_property>.keys 

The key array can be accessed using the keys property on an animated 3ds Max object property.

EXAMPLES:

$foo.position.keys
$foo.twist.angle.keys

If the 3ds Max object parameter is not yet animated (i.e., no controller has been assigned to the parameter), a value of undefined is returned.

   

<controller>.keys 

The key array can be accessed using the keys property on a controller.

EXAMPLES:

$foo.position.controller.keys
$foo[3][1].keys

   

Properties

<key_array>.count : Integer, read-only 

Returns the number of keys in the key array.

   

Operators

<key_array>[<index_integer>] 

Returns a MAXKey value representing the indexed key in the key array. Indexes start at 1.

   

Methods

append <key_array> <key> 

Appends key to key array.

   

deleteItem <key_array> <index_integer> 

Deletes the indexed key. Key indexes are 1-based.

   

addNewKey <key_array> <time> [ #select ] 

Adds a new key to the key array at the time specified. The value for the new key is the interpolated controller value at the specified time.

The new key is also selected if the #select optional argument is specified.

The value for the new key is the interpolated controller value at that time. addNewKey() will not add a key if a key already exists at the specified time.

The return value in this case is the key located at the specified time.

   

deleteKeys <key_array> [ #allKeys ] [ #selection ] 

Deletes keys from the controller according to the optional symbolic argument supplied.

#allKeys (default): deletes all keys in the controller.

#selection : deletes the currently selected keys

   

deleteKey <key_array> <index_integer> 

Deletes the indexed key. Key indexes are 1-based.

   

moveKeys <key_array> <time> [ #selection ] 

Moves all keys by the time given. If #selection is specified, move the current selection otherwise move all keys.

   

sortKeys <key_array> 

Re-sorts keys according to their times. Some MAXKey operations can result in out of order keys and this function must be called to correctly order keys.

NOTE:

All of the above methods may re-sequence keys in the key array and so cause existing keys to take on different indexes, because key array indexes are time positional.

Take care when inserting and deleting keys into arrays that have individual keys in variables and other containers - MAXKey values are defined internally in terms of this index and so may point to different keys if you re-arrange the keys in a controller.

MAXKeyArrays also support mapped property assignment on their contents in the same way that pathname and array collections do on their contents.

FOR EXAMPLE:

for i = 1 to 3 do
$box01.pos.controller[i].controller.keys.time += 10f
--bumps all position key times by 10 frames, --this is necessary because Position_XYZ has 3 sub-controllers


$cyl23.bend.angle.keys.value *= 1.2
--scales all the bend angle key values up by 1.2. 

EXAMPLE:

keys = $box01.bend.angle.keys
for t in 0f to 100f by 10f do 
addNewKey keys t