Saturday, June 11, 2011

Clean rotate values from your FK controls

Here's some basic rigging info that my coworkers needed.  As long as I put the effort into collecting it, I might as well share it with others too!

A lot of higher level rigging problems, particularly in the set-driven fixes area, can be avoided if your basics are solid.  While its amazingly easy to make a basic rig that moves things and appears to work, making one that will have clean values computed quickly, and thus make higher-level rigging easier, requires attention to some details that can be easily overlooked.

When making FK controls, its pretty easy to use orient constraints.  That's the first reaction of pretty much everyone I know.  However, the little snag to this approach is that 3D rotate math is a total mess.  If you just slap an orient constraint in without paying attention to the orientations of the control object and the joint its controlling, you'll wind up with some crazy numbers as the interpolation math runs its course.

Crazy numbers, of course, are a nightmare to use as drivers.

So its best to make sure your FK control objects are matched up to their driven joints right from the start.  I have some tools to do this automatically in my toolset, but knowing what's going on and how to do it yourself is always helpful.

The simplest control object is just a circle that's aligned to the joint, so it works great as an example.  We start with a simple nurbs circle.

Then we parent it to the joint it will eventually control.  This is only a temporary parent to steal the joint's orientation information.  Zeroing out the translates and rotates on the circle, and it will jump to the exact position and rotation it eventually needs to be.  It may not, at first, be oriented how you would want it to look.


Use the history (makeNurbCircle) to change its orientation, or rotate it and then freeze transforms, or even go to town editing its CVs.  Do whatever you need to to make it pretty at this point, as long as all the transforms are zero before you move on.


Now unparent it (shift+p).  It will stay in the exact spot you want it but will now have all of that orientation data showing up in its regular values.  If you freeze transforms to get rid of those irregular values, you will destroy the exacting rotate pivots you just stole from the joint.  Don't do it!  There's a better way.

Instead we create a group for the object and transfer the control's irregular rotations to that group.  This way the control object is zeroed out while having a different axis than the world.  This helpful group is called a null group or a rotate group.


If you're using my toolset, the buttons you're after are these:


The first two buttons, used together, will move an object to another object's exact pivot and rotation, and create a null group to zero it out there.  So for example, if you select a nurbs curve and then select a joint it is to control, these 2 buttons will automatically align it appropriately for use as a control object.  This is great if your control objects are created in the proper orientation (such as a nurbs circle with a normal of 1,0,0).

If you have a control object that is sitting where you want it to ultimately be, however, and isn't aligned properly, that's what the third button is for.  It will force your control object to conform to its joint's orientations and zero it out there, but without moving its apparent place in space.

Have fun rigging!


(This post was published Sept 4, 2011 after the official release of the character rigged in its screen shots.  For consistency the post has been manually dated to the original time of its writing, when the character was first being worked on.)

No comments:

Post a Comment