Delete Unchanged keys
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
Comments
Well, you have not turned
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.
my recent MAXScripts RSS (archive here)
Well, I'll try to explain it
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:
my recent MAXScripts RSS (archive here)
It took me a while to copy
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
Thanks I was never good at
Thanks
I was never good at learning a new language... :-)
I tested your code and it's
I tested your code and it's works.
my recent MAXScripts RSS (archive here)
Yes. It works on one object
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
Anubis, And here's version
Anubis,
And here's version four
Much more success but it is still reducing key outside the range I'm setting ... hopefully.
Cheers
look for reduceKeys() in
look for reduceKeys() in MAXScript Reference
my recent MAXScripts RSS (archive here)
Anubis, I've made some
Anubis,
I've made some progress but ...
I'm having some difficulty inserting some values into the expressions.
Help would be most appreciated.
:-)
Thanks for the tip. Cheers
Thanks for the tip.
Cheers