View Full Version : RH Euler (gimbal) Filter

01-09-2013, 03:11 AM
Hey all.

So... as the animators round here will know, LWs missing that all important euler filter for cleaning up gimbal flips in animation curves... most important when it comes to rendering with motion blur, or export animation for game engines and the like... so Ive built one. Well... am building one.

Now, to do it "properly" should involve differentiating curves via plain ol calculus to detect jumps and apply the appropriate corrections, however gimbal flips really only occur under certain situations, and in specific steps, (predictable behavior) so Im initially trying out a simpler variation plus/minus method which can run really fast (not that the proper method couldnt potentially be quick enough too), which I think should cope with all situations.

In my tests so far... all seems good, but Id like for any those of you with an interest to grab it, try it, and see if it performs without screw-ups, and let me know how it goes.

Usage... pretty simple, select the item or items you want to filter rotations for, and run it... boom.


01-09-2013, 03:38 AM
Great, thank you!

01-09-2013, 03:38 AM
thanks RebelHill i have to give it a try but i cant understand how in blender is posiible the gimball lock and not in Lightwave.Newtek some update please...
Rebelhill for president....you are the man....

01-09-2013, 04:08 AM
Awesome! Thanks! Just what I needed :)
And it working. I had to run in twice in my case but that's not a problem.

Thanks again!

01-09-2013, 04:15 AM
I had to run in twice

Interesting... if you could strip down/null replace/whatever and leave me the original scene/setup of yours that behaved this way, would be interesting to see.


And Drako... Ive no idea what you mean about blender... that suffers the same issue as LW (and maya, and max, and softimage, and everything else) in this regard. It DOES have quaternion rotations (in addition to euler) which LW doesnt, but that's something different, and not a very good choice for animating with, which is why everyone (just about) uses euler most of the time.

01-09-2013, 04:30 AM
I had to run it twice because the curve flipped more than once. For every flip you have to press once.

01-09-2013, 04:37 AM
Ah... ok, I see whats going on there... For multiple flips off the same "line", it only needs to run once, but your example has incrementing/compound flips (I had to run 3 times to fully clean)... I should be able to fix that automatically though... Standby.

01-09-2013, 04:48 AM

(btw... I recommend anyone still test both versions, incase this new one throws out erroneous behavior anywhere)

01-09-2013, 05:21 AM
Cool! Works perfectly! Thanks :)

01-09-2013, 08:32 AM
Interesting.. I thought quaternionBooster was supposed to address this issue.

01-09-2013, 08:51 AM
quaternionBooster? What's that?

01-09-2013, 09:07 AM
Its a motion modifier that uses quaternion rotations to help counter gimblelock problems, this modifier was introduced in lw10.
It can be found under the modifiers tab of the motion options panel.

01-09-2013, 09:28 AM
Quat booster doesnt really "remedy" anything, though it can be helpful. However, if you use it, and rotate stuff around (using local axis mode), Ull notice that all it actually does is perform a counter flip... so neither does it give you a quat (in the true, item channel sense) and neither does it get rid of euler flips (it just shifts them to different channels). Its handy if you gimbal lock, and want to animate off axis (local mode) without getting the euler "drift" but thats all... it still produces the flip (cos ofc, rots are ALWAYS stored as euler). you'll see I mention its use in my "using the RH rig" vids.

Oh... and it was introduced in V8. (sorry).

01-09-2013, 09:35 AM
Thanks for clearing this up Craig, TBH I havn't had time to play with quat booster, I was just riding on theories I heard, so its great to see you come up with a solution and while at it may I ask how this wonderful script of yours works?

01-09-2013, 10:04 AM
not working for me, I don't know what I'm doing wrong.
Perhaps its a pilot error, adding QuatBooster however remedies it but I'm still interested in why I can't get your script to work Craig.
See attached.

01-09-2013, 10:21 AM
you can download my scene and see that it works and what it's meant to be doing.

01-09-2013, 11:16 AM

01-09-2013, 12:09 PM
not working for me, I don't know what I'm doing wrong.
Perhaps its a pilot error, adding QuatBooster however remedies it but I'm still interested in why I can't get your script to work Craig.

Yep, yep... you've mainly just missed what its for. It for filtering curve discontinuities that occur as a result of gimbal lock compensations (like explicit poles, or things like quat booster). Load ur scene, turn on the quat booster, switch to rotation tool, and watch what happens at the crucial frame... see the axis jump on a single frame. Now bake your curves (try the RH motion baker if u like... http://forums.newtek.com/showthread.php?132517-RH-motion-Baker-plugin) kill the quat booster... motion remains the same, but look at your Fcurves in graph... see the jump. Rendering with motionblur, or exporting to a game engine, or similar, where the fractional frames would be caught, and this is a problem...

However... as it happens this one specific case, where the correction involves a 90deg shift in heading and bank is the one case that (to my knowledge) is unsolvable (mathematically) there's just nothing that can be done... so running my euler filter on these resultant curves does, basically, nothing. Truth is, giving the same problem to maya and using its euler filter produces no solution either (which gives me further confidence its unsolvable).

So what is the solution in this kind of circumstance?? Careful rigging. Its the KNOWING of this special case, and the further knowing of how a control will want to be used to dictates to a rigger how he would set such a system up in the first place, so as the flips produced are of the kind that can be solved... and that's basically about understanding your rotation orders, and preferred axis of rotation for a given control.