Monday, February 16, 2009

Tutorial: The Easiest Auto-Forearm Setup

Difficulty: Beginner

There are many auto-forearm setups out there, and I think that many have become overcomplicated. A lot of them work as expected, but as a Character TD you are concerned with efficiency and this method of rigging an auto-forearm is the lightest method I have seen out there. The only thing that will drive it is a single Orient Constraint... That's it!

The method will work for any type of arm Setup and will be integrated seamlessly into IK/FK, Stretchy, Bendy (a.k.a. Extra Deformation Controls). If you are using the 3-chain IK/FK switch, you should note that this setup will only need to be applied to the "real" joint chain (the one that you bind the skin to). It's also good for Game engines because of it's fast computation.

For me, the real beauty of this method is that it doesn't require us to change the end effector of IK Handles! We can simply draw the IK from the shoulder to the wrist because our Forearm will not break up the joint chain.

Without further explanation, let's get started!

Step 1: Draw the Arm Joints

You will only need to draw the following joints: Clavicle, Elbow, Wrist (you can also draw the hand & fingers if you wish). Note that we skip the Forearm joint in the creation of the initial joint chain. (See Fig. 1)


Fig. 1 : All the Joints.

Before you proceed, make sure that all your rotations are correct. If you don't know how to do this properly, you probably shouldn't be messing with them so I won't go into details in this tutorial.

Step 2: Create the Forearm Joint

Let's create the Forearm Joint now! This is done by simply by selecting the Elbow joint and Hitting Ctrl + D to duplicate it. Rename this new joint (Elbow1) to Forearm in the Channel Box. We are doing this for 1 important reason; Our Forearm will have the exact same orientation as our Elbow joint, which makes sure it is pointing towards the wrist as well. (See Fig. 2)


Fig. 2: The Forearm joint with the copied hierarchy under it still.

Open up your outliner. Select the next joint under Forearm (it will be a copy of the wrist joint) and Delete it. You are now left with only the Forearm joint and it should be parented under the Shoulder. (See Fig. 3)


Fig. 3: The Hierarchy in the Outliner.

Step 3: Positioning the Forearm Joint

We want to position the Forearm between the Elbow and Wrist joints now. The 2 most popular spots that I've seen it placed is either halfway between the Elbow and Wrist, or 3/4 away from the Wrist (so closer to the Elbow Joint). Here's how you can do either.

Select the following joints in this order: Elbow, Wrist, Forearm. We are going to perform a Point Constraint to figure out the distance between them. Before doing that, make sure that "Maintain Offset" is unchecked in the options box, then hit the "Add" button. This will by default place this joint exactly between the Elbow and Wrist Joints. If you want to change this position to 3/4s, go to the Channel Box and look for the "Forarm_pointConstraint1" node. There are 2 boxes at the end of this node labled "Elbow W0" and "Wrist W1". Change "Elbow W0" to .75, and "Wrist W1" to .25 . Essentially all we have done is adjust the weight to be 75% allocated to the Elbow and 25% allocated to the Wrist. This ends up giving us the 3/4 (or 75% if you know your fractions :) ) distance. (See Fig. 4a & 4b)


Fig. 4a: The Point Constraint Options Box settings.


Fig. 4b: The Constraint Weights in the Channel Box.

In your outliner, select the "Forearm_pointConstraint1" node and delete it.

Alternately, you could skip the Point Constraint Process and use the Move tool to place the Forearm into position. Make sure you double click the Move tool and choose "Object" under the Move Axis. The select the Forearm joint and pull on the axis that is pointing down the bone (the X axis a.k.a. Red arrow is Maya's default).

Step 4: Creating the Connections

Now that the Forearm is placed, parent it to the Elbow by selecting the Forearm followed by the Elbow and hitting "p" on your keyboard.

Next, select the Elbow Joint, then the Wrist Joint, and Finally the Forearm Joint and perform an Orient Constraint with the following Options: Maintain offset is Checked, and then under Constraint axes check only the twist Axis (this is the axis that points down the bone in the move tool. If you are using the Maya Defaults, then that will be the X axis). (See Fig. 5)


Fig. 5: The Orient Constraint Options box settings.

If your Forearm Joint is exactly between the other 2 joints, then you are done! If not, then you will need to adjust the Constraint Weight to get the desired result. This is done exactly the same as we did earlier to position the joint using the point constraint. If you did the 3/4 weight, then you will adjust the "Elbow W0" attribute to be .75 and the "Wrist W1" attribute to be .25 just like before. If you eyeballed the position of the Forearm joint using the move tool, then you'll have to guess on the numbers (if it's closer to the wrist joint, give the Wrist W1 weight more of the percentage. If it's closer to the Elbow, give the Elbow W1 weight more of the percentage. ALWAYS try to get it so that when both numbers are added you get a result of 1).

What we have just done is told the Forearm joint to rotate in a specific range. Since the twist Attribute of our Elbow joint should never change from 0, the expected twist should be equal to a percentage of the rotation of the Wrist (again, this is determined by the weight). Let's say that the weight of the wrist is at .5 (50%). When I rotate the wrist 20 degrees, the Forearm will rotate 50% of that and rotate to 10. When I rotate -30 degrees, I get -15, etc. If I had .25 weight to the wrist (the Forearm is closer to the elbow, in other words), I could rotate the wrist 20 degrees and the Forearm would rotate 5 degrees (20 * .25 = 5).

On a side note, by default the 2 weight values are both set to 1. This is done because most of the time an orient constraint is done by 2 objects instead of the 3 in our case. By setting the weight values of each of these to the same number, you will get a result of .50 weight for each (or 50% influence from each object).

See, that wasn't too bad! While this setup is not Gimbalproof, it will be safe within normal ranges of motion for the arm.


Fig. 6: The finished setup and the Hierarchy.

Now all that's left is to bind the skeleton to your mesh and paint the weights.

1 comment: