getController from array
Say for example I have an array that contains the numbers which represent a subAnim controller.
How could I build a variable which would allow me to directly get to that controller.
( delete objects obj = teapot() subIndexes = #(3,1,1) -- SubAnim:X_Position clearlistener() -- example b = obj[3][1][1] -- I need to build an array with the subIndexes that would return SubAnim:X Position -- Keep in mind that the length of the subIndexes could change depending on the situation. )
Comments
Anubis after further messing
Anubis after further messing around your script returns just the controller, I need it to return the object and controller
ex. Yours returns
'subAnim: X_position'
I need
'Node[3][1][1]'
Which would be the controller path and the node.
John Martini
Digital Artist
http://www.JokerMartini.com (new site)
my function do what you ask for :)
You can work with both "subAnum.value = get/set value" or "controller.value = get/set value", but if you prefer the function to return controller instead of subAnim, then just change last line to "sa.track".
And Node[3][1][1] is still SubAnim. If you need string, then use
exprForMaxObject
as Branko suggest.my recent MAXScripts RSS (archive here)
Soory for intrusion. Maybe
Soory for intrusion. Maybe this will help
bga
edit :)
edit
Now we will use again "excute" fn after u get the result from below fn
bga
Anubis! Hey bud.
Thanks for the snippet. It seems like that is more of what I'm after. I'm never a bit fan of execute. Thanks guys.
John Martini
Digital Artist
http://www.JokerMartini.com (new site)
Hi John
or maybe just...
fn returnSubAnim obj arr = (obj[arr[1]][arr[2]][arr[3]])
woops, I miss last note... the sub tree is not fixed to 3, right?
P.S. corrected:
my recent MAXScripts RSS (archive here)
Thank you very much
Thank you very much
John Martini
Digital Artist
http://www.JokerMartini.com (new site)
Hi John Try this fn
Hi John
Try this
bga