Hi
I'm a newbee script writer
I'm trying to get my head around writing a script that would select all the unchanged keys in an object's animation and delete them. A little like Biped can thin out the every-key-on-every-frame when it imports motion capture data.
Cheers all
Craig
By
Comments (10)
Comment policy
Well, you have not turned attention to the syntax of my example. If use count-loop "for i in 1 to $.count" (ie loop by index) then "$[i].controller" is correct, but in other loop is "i.controller". See the difference, right?
P.S. - Opss... just me ahead. I see that you did.
Well, I'll try to explain it briefly. Then loop in selection by index selection[1] is the 1st node in selection, but if there only one node selected, those loop run inside object subAnimLevels instead of returning baseObject, so speaking briefly:
Thanks
I was never good at learning a new language... :-)
It took me a while to copy your line correctly - can your believe it took me three goes to type it in correctly?
All working smoothly without the added point
Thanks
I tested your code and it's works.
Yes.
It works on one object but fails if there is more than one object selected.
If I modify my code like this ...
for i in 1 to $.count do
(
reduceKeys $[i].controller SP_Threshold.value SP_Duration.value animationrange
)
it works for multiple selections but fails for a single object.
Any clues so it will handle both?
Addendum :-)
I had another thought and it's probably a bit of a cludge but I had the script add a tiny point helper and add that to the selection so there is always more than one object in the selection - loop does not fail - then delete it afterward.
The screen redraw is a little disconcerting but with multiple objects you get a screen redaw after every loop.
Any clues?
Cheers
Attachments
Anubis,
And here's version four
Much more success but it is still reducing key outside the range I'm setting ... hopefully.
Cheers
Attachments
look for reduceKeys() in MAXScript Reference
Thanks for the tip.
Cheers
Anubis,
I've made some progress but ...
I'm having some difficulty inserting some values into the expressions.
Help would be most appreciated.
:-)
Attachments