View Full Version : adding keys

01 January 2008, 09:58 AM
hi, I'm new to maxscript and i've this problem:
I've an object with position constraint and some target, so when i press a button I need to addkey to every weight. I found in the reference the "AddNewKey" but when I use it in this way:

addnewkey $.pos.controller.weight[1] currenttime

it returns undefined. where's the mistake? it's not a controller? for example if I wire weight to another track I can use addnewkey.

01 January 2008, 11:47 AM

addnewkey $.pos.controller[1].controller currenttime

Be aware that by default there is no controller available to weight tracks, you'll have to assign them first before creating keys

$.pos.controller[1].controller = bezier_float()

You were accessing a property of the controller containing the results of the weight controller, not the controller itself.

Also check out the interfaces available

showinterfaces $.pos.controller
<node>getNode <index>nodeNumber
<float>getWeight <index>targetNumber
<boolean>setWeight <index>targetNumber <float>weight
<boolean>appendTarget <node>target <float>weight
<boolean>deleteTarget <index>targetNumber

Maybe something in there you can use,


CGTalk Moderation
01 January 2008, 11:47 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.