[Closed] biped – get keys?
i’m writing an anim baking function that will check to see if a key exists on a frame #, and if so, place a sliding / free key (based on user’s choice).
i would have no problems if i were doing this with anything else but biped (surprise), because i could just query obj.keys and do a compare against the desired frame range. however, biped.getKey seems to have no way to query a count of keys. instead, the only way i have thought of to get around the fact that i can’t count to known amount of keys is to essentially create an infinite loop and use “try / catch” to break out of the loop after the biped.getKey runs out of key indices. technically that works, but i feel like i need to take a shower to get all the dirt off of me because it’s so messy. furthermore, if i try to put that block of code inside of a “for” loop to run on multiple objects, the try/catch breaks out of the block expression, including the “for” loop. so it can only be run on one object.
is this really the only way to query keys on biped objects? it’s baffling that bipeds keying system is so drastically different from max’s keying for the rest of its objects. not surprising, i guess, but it’s still mindblowing.
honestly i don’t understand the problem…
every biped node has biped controller. every biped controller has property #keys, also you can use max function getkeyindex for any biped controller…
bipednode.controller.keys
bipednode.controller.keys[i].time
k = getkeyindex bipednode.controller 10f
(biped.getkey bipednode.controller k).time
biped root has 3 controllers but they work the same way
actually the node.controller.keys gives me what i want. i was looking for an array that i could count to, but using biped.getKey didn’t give me that, so i was having to make this terrible count using try/catch.
i guess it was just a matter of finding which subanim track contained the keys… which is also pretty confusing.