Notifications
Clear all

[Closed] SelectKey problems

When assigning a path_constraint controller max will by default make 2 “percent along path keys” for the node (at the start frame and the end frame of the current set timeslider). In my end script I’d like to move the key at the end frame to another frame.

First I need to select- but I can’t figure how.

I’ve tried:

selectKey $.pos.controller.path_constraint 2

and the SubAnim way:

selectkey $[3][1][2] 2 and selectkey $[3][1][2][1] 2

The error message is:
– No ““selectKey”” function for SubAnim:Path_Constraint

Cannot figure out what I’m doing wrong- had the same problem when working with posXYZ keys… TCB woked fine.

Hope someone can point me in the right direction

3 Replies
 JHN

Pecan,


pc = selection[1].pos.controller[2] -- assumes a list controller and path constraint is on the second layer

show pc  -- show all pathcontroller properties

pc.percent.controller.keys

pc.percent.controller.keys[2].time = yourtime
pc.percent.controller.keys[2].value = yourvalue

You’ll need to get to the controller first to get to the keys, even though subanims are shorter writing, I prefer the above method for clarity. Every animated controller has a .keys property with an array of keys, after that manipulation is simple.

-Johan

Thanks Johan! My understanding how controllers are organized in maxscript reaching for new levels

 JHN

I know I messed around with keys a lot to in the beginning, till I found out they are all needly ordered in the controller.keys array… it’s good learn something new!

-Johan