Page 1 of 1

Smoothy

Posted: Sat Jun 13, 2009 12:08 pm
by chucky
Ok fellas,
Does anybody know of a tool that will smooth a congested timeline or reduce keyframes by degrees depending of translation and or rotational proximity ( much like point reduction on the freehand tool but for keys on timeline)

Here is why, my mocap experiments although going quite well- gives me these kind of results in the bone channel.

Image

I will be posting mocap experiments soon BTW

I know the motion targets have smoothing, which is a simple every other frame reduction, but other channels do not and besides a more appropriate key reduction method is really needed.

PLease help gurus..... :?

Posted: Mon Jun 29, 2009 12:31 am
by Rudiger
Here is a menu script that will adaptively reduce the keyframes for tracking points only, using a similar algorithm to the Freehand tool. Chucky's already done the beta testing for it, so if anyone else is interested in playing with this motion capture stuff (or you just want to have a laugh at some amateurish code :D), feel free to give it a try as well.

rt_reduce_channel_keys_v0.1.zip

It should be pretty self-explanatory, but here's a few tips to get you started:
It only works on tracking points at the moment, but it would be possible to make it operate on any channel if there is a demand for it.
At the moment it's undoable, so if you get a bit overzealous with your tolerance settings and blow away too many keys you can undo to get them back. I've found the best way to use it is to run it multiple times, slowly increasing the tolerance settings each time until it's as smooth as you want it.
I also added a feature so you can specify a start and end frame for it to operate on. If you keep the "entire channel duration" box checked, you won't have to worry about setting this.
The "Frame Scale" parameter is only used for the angle tolerance and controls how stretched out or bunched up the timeline motion curve is (like zooming in and out in graph mode). With a setting of 1, the number of pixels per frame is equal to the pixel tolerance. I just left it at 1 during my tests and it seemed to work OK.

One thing I did notice with my testing is, the smoother you make it, the more "disconnected" the tracking points seem. I think it's because my script operates on each tracking point individually so they no longer have keys on the same frames. Let me know if it's an issue and I could think about adding an option to process the tracking points all at once, so if one point has requires a key on a particular frame they all do.

By the way, Chucky, I made a few internal changes to how it handles start and end frames, so you might want to redownload it.

Posted: Mon Jun 29, 2009 3:00 am
by madrobot
Wow. Great job! Thanks for sharing this Rudiger.

(Out of interest, does it work in 5.6?
If not, how hard might it be to make it 5.6 compatible?)

Posted: Mon Jun 29, 2009 3:31 am
by chucky
This particular script only works on tracking keys, sorry robo.
This is because it operates on the keys input values rather than the the keys signifying marker on the timeline. I hope that makes sense

Posted: Mon Jun 29, 2009 3:35 am
by madrobot
Sorry guys, I did read that but it obviously didn't sink in.

Posted: Mon Jun 29, 2009 5:04 am
by VĂ­ctor Paredes
Oh, thanks for the script! it looks very cool. I'll try.

Posted: Mon Jun 29, 2009 5:32 am
by Rudiger
madrobot wrote:Wow. Great job! Thanks for sharing this Rudiger.

(Out of interest, does it work in 5.6?
If not, how hard might it be to make it 5.6 compatible?)
What channels did you want it to optimize? I can add them without too much hassle. The hardest part would be getting around the difference between how the Localize function works now and how it used to work. I'm not sure what other scripters are doing, but I've added the Anime Studio version number to the LM interface by placing a script in the utilities directory. I could use this to call the Localize function differently depending on the version.

Posted: Mon Jun 29, 2009 5:53 am
by madrobot
Thanks Rudiger

You know what?
The key reduction script is probably really only useful with motion tracking,
so I probably don't really need it in 5.6, hey?

Excuse the distraction