Friday, January 30, 2009

Pesky gimbal spinning problems got you down?

I've been meaning to make a short video tutorial about how to solve gimbal spinning for a while now. Today I figured was a good time to do that.

Here's my little way of solving those pesky gimbal spinning problems...


It's about 7 minutes in length.
Note- this is NOT a solution for gimbal lock, which is a different kind of gimbal problem. (one not quite so easily solved, unfortunately)
Caveats aside, I hope this helps some folks.

22 comments:

Matthew Long said...

Thanks for that Keith, I'm sure it will help a lot of people, especially those traditional animators just starting out in 3D and being confronted with this computer-only problem. Helps reduce the frustration.

J. Shamblin said...

Thank you for this video. It's very kind of you to go through the trouble of creating it. I just started experimenting using Maya the other day, and you may have just saved me hours of frustration!

mattanimation said...

I just ran into this problem when animating the Max for Maya rig the other day and you have helped me immensely! Thank you! I was only going half way like you showed in the video, I just never thought to drag my curves lower in the editor.

Anonymous said...

Thanks for the video Keith. We've all banged our heads against the desk once or twice over this one. I think that saying the Euler filter works about fifty percent of the time is being generous. There is a user modified version of the tool on cgTalk that seems to be way more effective. Apparently something was changed in Maya 2008 to make it not work properly. I can't vouch for that, but this one does seems to work much better.

http://forums.cgsociety.org/showthread.php?f=7&t=580529&highlight=euler+filter

Make sure you grab the one lower down on the thread.

Josh Bowman said...

Great tip Keith, I love simple ways of solving stuff like this.

Dane said...

your tutorials rock man!

Paul said...

Hi Keith,

Great tutorial. That's a nice manual fix.

I wish Maya would just adopt the "gimble killer" filter from Motion Builder. It works just about every time. Sometimes if you're working with mocap, or you have some procedural animation that's been baked down, the gimble freak outs are all over the place, and they can be a nightmare to try to fix by hand.

Anonymous said...

Hi Keith,

Great tutorial. Sometimes you need the adjustment to be exact, like if you baked the curve and are matching a camera move or something like that.

So I have an additional step that I take.

The same point in space can be represented by rotations in multiples of 360. In your example, you move the keys from 250 to -453. Which is a 703 degree difference. I know of the top of my head that 720 would be the exact rotation, a multiple of 360.

So I would then undo until the keys were back in the same place. With all of the keys that I want adjusted selected, then in the key box I would type -=720

This moves all of the selected keys by -720, and you have your rotations in exactly the same place for all of the selected keys.

Like I said, this extra step is only if you need the rotations to be exact. I am a big fan of doing it by eye, like Keith demonstrates.

Hope this helps.

Ian said...

Hi Keith

I've done a bit of teaching, and this is one of the hardest things to explain without making the students brain melt and start dribbly out their ears, especially if they are a visual type person who is mostly oblivious to the maths going on behind the scenes. You have done a good job handling it here, and I'll be recomending it to future students :)

If you ever have the time and energy I would also love to hear how you deal with situaltions where two of your rotation axis end up lining up.

Brocknoviatch - Thats a great tip, I've been using Maya for years and had no idea you could do anything other than type a simple number in that field in the GE. Thanks heaps :)

Anonymous said...

Keith, thanks a lot for this! I'll have to keep this in mind, but moreover, the annotatepro recommendation was exactly what I needed for something else I'm working on! Your blog is a lifesaver :)

Nate said...

Thanks for the quick tut Keith!

Ben2 said...

Hi Keith,

Nice. In my limited experience, rotation flips that have been caused by gimble constraints seem to often happen across multiple axes at the same time, so moving the knots in the graph up or down is not so trivial. Moreover, you can end up just shifting the flip to a later point in the animation. Fortunately I haven't yet found a case where the Euler filter fails me.

Can you share with us what application you've used to record this tutorial video please?

Cheers,
Ben.

frank said...

Hi Keith,

Thanks for that information.

I'm one of Ian's (above commenter) students. I note Ian didn't mention a video tutorial that may interest some of the people reading these comments. It explains gimbal lock quite clearly. Even a student with a molten brain can understand it.

Gimbal lock The Rotation Problem

I hope it might inspire you to post on your instincts about gimbal lock. Please?

Bryan Magan said...

Hey Keith great work around. But I noticed that you were using Maya 2008. As someone noted above the Euler filter doesn't work in that version. So head over to Autodesk's site and download Maya 2008 Service Pack 1 for a free upgrade. That would fix the Euler filter.

Keith Lango said...

Bryan- Thanks for the 2008 SP1 recommendation. That will probably help. Plus I wanted the soft select feature, too. I've just been lazy about downloading that patch. Stupid, lazy Keith.

Ian- As for the more problematic 2 channels over-riding gimbal lock, I usually just key my way through that one frame at a time. Often CG presents a technical challenge that is best solved by "analog" methods. Yes, keying each frame of a transition is tedious, but it is a task with an end. Where as trying to come up with some curve magic in the Graph Editor is a Quixotic quest at best. In the end the brute force method is easier and faster. So if I have a lock and things get goofy for a transition I'll just key every frame of that transition until things come free. It's actually not anywhere near as hard as it sounds, and you get good at it after a while. Now if the lock persists for a long period of time and isn't just part of a transition, then the only remedy I've seen is to have an extra hidden controller up the hierarchy that you can unhide and grab to override the locked controller. it's stinky and klunky, but it works.

Ben2- If the problem is across two channels I've been able to make this solution work without much difficulty at all. It's just a matter of being attentive to what you're doing. The key for me is to get an accurate picture of what the target rotation looks like on the model. You can make an animated snapshot for the frame to get that picture, too. (but that's some some obscure Maya command). For me just drawing the desired shape on screen is often plenty fine. Also I used Camtasia Pro to make this and all my videos for the APT. It's not cheap, but it's great software for stuff like this.

Brocknoviatch- I hate math. :) Even so I've used those += and -= commands in the GE before. Very handy.

Mark DeRidder said...

Great video Keith! I have come across this solution as well and there is no beating it. It's even more fun when you have multiple channels and it crosses back and forth a few times within a shot, but it is all salvageable.

This is a very important educational lesson and should alleviate a LOT of stress and frustration for new animators.

-Mark

Ian said...

Hi Again Keith

I've made students sit through the "Keying Every Frame" aproach in the past and often felt a little guity for not having some more fancy fix. I glad to hear I'm not the only one who tackles things like this and can point people to your blog if I need some back up from a student who wants a push button solution :P

Cheers

frank said...

Hello again Keith

Ian (comments above) has made me sit through the key every frame method to fix a wayward arc.

The extra information about the Euler filter in the Graph Editor and the Maya 2008 Service Pack upgrade from the people commenting, hopefully will get me a push button solution option before I need to key on ones again.

Dang that motion blur thing.

Anyway this has been an illuminating post and discussion. Thanks everyone.

Thom said...

-=360 or +=360 until it works. Basically the same thing as what you do but even more fasterer.

Anonymous said...

Great tutorial!
But some how we are getting caught by technical things again...We expect some more great stuff from you. You are some kind role model to the animators. so we expect that sort things.

FleaCircusDirector said...

Good clear tutorial Keith, do you get the issue in Maya where two spline curves interact? It happens in apps like Poser when you have a boundry between two different motions e.g. a figure lifting their arm from their side, waving then putting their arm back down at their side.

Anonymous said...

Hi Keith. Haven't tried this on a character rig yet, but do you know if switching the rotation type to "gimbal" would avoid this? I use it all the time I need a 360 using Maya 2k8.

But again, not for character rigs.