View Full Version : Best way to reduce key frames from motion capture

02-03-2014, 11:36 PM
Any best practices on this? I have a 900 frame capture and want to reduce the key frames to improve performance. I tried using the Stretch and Snap keys plugin by reducing frames to 450 and then I increased them back to 900. This seemed to work, except for some flipping (which I think is subframe quaternion flipping). Chazriker posted on ikb topic that this can be fixed with a euler filter. I think there's a plugin called pitch correction 2 that may do this.

Any comments on this? Is this the most efficient way to reduce keyframes and still maintain fidelity of the original motions.


02-04-2014, 07:25 AM
Here... Resampler and euler filter... Just select your items and run the script(s).

Ryan Roye
02-04-2014, 08:10 AM
The graph editor is the best native way. Select all the bones, reduce the FPS by 1/2 or 1/4th of its original (via preferences general tab), go into the graph editor, select all the keys for every item and in the keys pulldown menu pick "snap to keyframes". For baked motions, this effectively chops the number of keyframes in half or more uniformly. After reducing keyframes you'll usually need to run a euler filter on your entire rig due to euler flipping (typical of motion capture), so pitchcorrection2 (https://www.lightwave3d.com/assets/plugins/entry/pitchcorrection2-beta2/) is advantageous because you don't have to worry about it destroying your animation and can simply select all the bones and run it without having to be careful about the selections or having to scrub around the timeline to search for errors.

The graph editor also has a key reducer built right in, but its usage is not always predictable which is why I prefer not to use it instead.

02-04-2014, 11:21 AM
maybe this, not sure though...


you got several options now... http://forums.cgsociety.org/images/smilies/arteest.gif

i have no idea which is the best one... http://erikalstad.com/backup/misc.php_files/smile.gif

02-04-2014, 12:07 PM
Interesting... Depends what kind of reduction ur after. There's my key reducer, which removes keys based on how different their values are to neighbouring keys (similar to ur post there)... The one I posted above is a curve resampler, which lets you "re-key" the curve at an alternate frame rate (so doesnt care about what the values are... it just remakes fresh keys along the same curve path). This other one you show though seems to be trying to let you reduce keys in terms of "motion continuity"... so if a value is just going in a single direction linearly, it'll kill the unnecessary intermediate frames... also useful.

Im also looking at putting out an intelligent key reducer at some point which'll let you convert dense key data down to much lighter curves, whilst maintaining the shape of your curves... Thats a lot trickier, but we'll see how we go once I get there with that one.

02-04-2014, 12:34 PM
i noticed KeyReducer.ls has an open source, so it might be that you can learn a thing or two from it.
not for me though... not smart enough. http://erikalstad.com/backup/misc.php_files/smile.gif

also see Keystrainer, but do note that it is 32bit only...

02-04-2014, 10:53 PM
Thanks folks! I ended up using RebelHill's plugins. They were fast and easy to use.

(I'd definitely be interested in a future version that takes dense curse and makes them lighter, while still keeping the general shape)

Followup question: what's the best way to smooth out mocap data in Lightwave? I'm getting pretty good capture, but there's still some cleanup.

02-05-2014, 06:31 AM
If you want smoothing of curves, there's a couple things u can try. U can try the key reducer in my animtools pack http://rebelhill.net/html/shares.html Used with the default very small threshold, its a simple reducer that dumps keys when you have a long line of keyframes at the same value... but turning the threshold up can get it to kill of lil jitters in motions. Depends on the particulars of the curve and motion though... its not *really* designed for such, so sometimes used like that it gives better or worse results.

Else, you can have a go with my curve smoothing filter... a simple laplacian that can be used either as a smoother or a peak remover...


02-05-2014, 10:25 AM
Thanks, RebelHill! I'll try these out later.

02-22-2014, 06:53 AM
Hey RH... Thanks for the plugins.

Just found this thread... had a Mocap running at 120fps... I installed your plugins tools, and I'm trying at 15fps now to see if it smooths the motion a bit. One suggesion, (and maybe a bug?) Since most mocaps have a T pose at frame 0, any suggestions how to leave it and frame 1 intact while resampling the keys? Oh, and when I imported the plugins into LW11.6.2 (beta), they both showed up as "RH Euler Filter".

Thanks again