GENERATE/PREV.gifGENERATE/NEXT.gif

Key Array Functions

For convenience, MAXKeyArrays support four functions that are the equivalents of the same-named functions on controllers. See the Key Operations topic for each of these functions.

addNewKey <key_array> <time> [#select] [#interpolate]

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

deleteKey <key_array> <index>

sortKeys <key_array>

Example:

keys = $box01.bend.angle.keys

for t in 0f to 100f by 10f do addNewKeys keys t

All of the above functions 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 congtroller.

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

$box01.pos.keys.time += 10f

bumps all key times by 10 frames, and,

$cyl23.bend.angle.keys.value *= 1.2

scales all the bend angle key values up by 1.2.