Arm and Hand Controls


Kila and Grae's arms and hands, as is, are quite capable of giving us the animation we need. We can manipulate the shoulder and elbow joints to pose the arms quite easily; we can even go in and animate the individual fingers. Adding further controls to the arms and hands, however, will make posing them quicker and easier to do.

Arm Controls

Currently, Kila's arm inherits the rotations of the clavicle. As you can see in Figure 12.12, when the clavicle rotates, so do the shoulder, elbow, and so on. So we first need to lock the shoulder's rotation to another, independent control; this will give us complete command over its movement.

Figure 12.12. Lock the shoulder's rotation so it's not dependent on the clavicle.


Begin by loading the file Kila_Skeleton.mb.

1.

Select the left shoulder joint and create a duplicate of the arm, making sure to set Group Under in the Duplicate options to World. This ensures that the new arm is not parented to the spine or any other joint.

Move this duplicate back slightly so we can see it (Figure 12.13, middle). This will be the control arm.

Figure 12.13. Duplicate the arm and remove the fingers to create a control arm.


NOTE

Use a duplicate of the main joints in order to retain their orientations.

2.

Delete the finger joints from the end of the control arm, leaving just the shoulder, elbow, and wrist joints (Figure 12.13, right).

3.

So that you can distinguish the control arm from the normal arm, rename the new joints to L_ConShoulder, L_ConElbow, and L_ConWrist

4.

Lock the rotations of the normal arm to the control arm. Select the control shoulder first, then the normal shoulder, and go to Constrain > Orient and open up the options.

An orient constraint locks the orientation of one object to another, so in this case our normal arm's rotations will be locked to the control arm's rotations. When the control arm rotates, the normal one will follow.

5.

Look at the options for the Orient Constraint in Figure 12.14. Turn off Maintain Offset, and set Constraint Axes to All. With the tool configured, click Apply. (If you now select the L_Shoulder joint, you will notice that the rotations in the Channel Box have turned blue; this indicates that they are being controlled by another object.)

Figure 12.14. Orient Constraint options


TIP

The Maintain Offset option is useful when your initial rotation attributes are different on each object, yet you want to keep the current orientation. Without Maintain Offset enabled, the constrained object would inherit the control object's exact rotations, potentially flipping it.

6.

Try rotating the control shoulder; the normal one will follow. Even better, if you now rotate the clavicle, the shoulder will keep its original orientation (Figure 12.15). This means the arm can hang free.

Figure 12.15. The shoulder's orientation is no longer affected by the clavicle.


7.

Continue this procedure, orient-constraining the main elbow to the control elbow, and the main wrist to the control wrist joints.

The control arm is eventually going to lie over the main arm, so we need to make it easier to select. Here is where we will use Maya's selection handles.

1.

Select each joint in the control arm and go to Display > Component Display > Selection Handles. You will see the handles appear at the center of each joint.

TIP

If the handles are not visible, make sure their visibility is turned on in the current view by going to Show > Handles.

2.

Next, you want to move the handles away from the joints. Go into Component mode (F8), and select the cross next to the question mark in the status line.

3.

You can now edit the selection handles' positions, moving them out and away from the joints (Figure 12.16).

Figure 12.16. Edit the positions of the selection handles.


4.

Press F8 when you're finished, to leave Component mode.

Finally, we need to lock the control arm's position to the main arm's shoulder, so the control arm will follow where the main skeleton goes.

1.

Select the main shoulder, and then the control arm's shoulder.

2.

Just as we locked the orientation, we can also lock the position. Go to Constrain > Point, and configure the options as you did for the orient constraint, turning off Maintain Offset and setting Constraint Axes to All.

The control arm will now be in exactly the same position as the main arm, and you can now control the left arm with the control arm. In addition, its orientation is free from the clavicle's, allowing the arm to hang free. Follow this same procedure to create a control arm for the right arm.

At this stage, I recommend creating two new display layers, one called Skeleton (with a display color of dark gray), and the second called Rig_Controls (with display color set to white or an equally light color). Place the main skeleton in the Skeleton layer, and the new control arms into the Rig_Controls layer. This will help us differentiate between the two objects.

Arm IK

We already have FK control over the arms, because this is based on simple rotations of the joints, and we can quite easily work with the control arms to animate the main arm. Now let's add the option of IK so that we can lock the hand's position in space.

First, set the Skeleton layer to Template. We will be working only on the control arms, so we don't want to accidentally select the main skeleton.

1.

Go to Skeleton > IK Handle Tool and open the options.

2.

Configure the options for a Rotate Plane solver, with the solver enabled and sticky, and then click Close. Your mouse pointer is now a cross.

3.

Select the control shoulder joint, followed by the control wrist joint. The IK is then applied, giving you the main IK handle (Figure 12.17). Rename the IK handle to L_ArmIK.

Figure 12.17. The arm with IK applied


The basic IK is now applied, but using the IK handle as an animation tool can cause problems because its translations cannot be frozen. We need all the main animation controllers to have default values of zero; otherwise, we might discover problems when we want to return to the default pose, or if we need to transfer animation between sides of the character or to other characters.

In addition there is currently no visual aid to tell us where the pole vector is, so we will add an icon to tell us this. That way, we always know where the elbow is pointing, and we have a means of easily positioning it.

With these aids in place, we can implement the final controls, allowing us to switch between IK and FK control.

1.

To represent the IK in the left arm, a simple NURBS circle will do as our icon. Go to Create > NURBS Primitive > Circle. Snap the circle to the wrist joint (press V); then scale and rotate it so it loosely fits around the wrist (Figure 12.18).

Figure 12.18. Position the circle around the wrist.


2.

With the circle in position, freeze the transforms. Then delete the history on it so it is nice and clean, and rename it to L_Arm_IK.

To transfer between IK and FK control, we use the tools found in the Animate > IK/FK Keys menu. These allow us to turn the IK on and off, and to set keys on the joints affected. These keys, however, will only work on the IK handle. To make the rig more efficient, we want to transfer this control across to the circle icon.

3.

Select the circle. Holding Shift, select the IK handle, and go to Animate > IK/FK Keys > Connect to IK/FK.

With the icon selected, you can now turn the IK on and off via the Animate > IK/FK Keys > Enable IK Solver menu item.

4.

You can now parent the IK handle to the icon so that it will move wherever the icon does. To do this, just select the IK handle, then the icon, and press P.

Next we will add control to the character's elbow by fixing the pole vector to a second icon.

1.

Import the file Icon_Cube.mb (found in Project Files/12/Icons), and snap its position to the left elbow. Adjust its scale so you can see it clearly over the geometry, making sure you freeze the transforms afterward.

2.

Select the cube, then the IK handle, and go to Constrain > Pole Vector. The elbow's position will now be locked to the cube.

3.

Rename the cube to L_ElbowPos. Then hide the main IK handle, and assign both icons to the Rig_Controls display layer.

This completes one arm. Go ahead and work on the right arm (Figure 12.19) next. The control arms should lie over the main skeleton's arms.

Figure 12.19. Both control arms, with IK and icons applied


Now follow the same procedure for adding IK to Grae's arms:

1.

Duplicate the main arms to create the control arms, renaming the new joints accordingly.

2.

Orient-constrain the main arm joints to the control arm so that they will inherit the control arm's movement.

3.

Make the display handles visible on the control arm, and edit their positions.

4.

Point-constrain the control shoulder to the main skeleton's shoulder so that the control arm always lies in the correct position.

5.

Add the IK handle between the control shoulder and the control wrist.

6.

Add two icons, one to control the IK and another to control the pole vector. Position the IK control over the wrist and the pole-vector control over the elbow.

7.

Set up the FK/IK switch on the wrist icon; then parent the IK handle to the icon. Set up the pole vector constraint between the IK handle and the elbow icon.

8.

Create two display layers for the skeleton and rig controls, assigning the appropriate elements to each.

With Grae at the same stage now as Kila, we can proceed with the rig on Kila.

Wrist Controls

Like the shoulders, the wrist's rotations should be independent of the forearm's. This will give the animator greater freedom when animating, because the hand can be positioned and will stay in that pose regardless of how the rest of the character animates.

1.

On the left arm, hide the selection handle you made visible for the control wrist joint (we are going to create a new wrist control, so we don't need this selection handle to be visible anymore). Select the control wrist and go to Display > Component Display > Selection Handle.

2.

Duplicate the control wrist joint and move it back slightly (Figure 12.20). Rename it to L_ConHand.

Figure 12.20. Duplicate the control wrist joint.


Again here, we need to retain the correct orientation, so we are using a duplicate of the wrist joint as the main controller.

3.

This will be the main controller, so make the display handle visible. It should retain the position of the joint from which it was duplicated, so you don't need to reposition it.

At present, the control wrist inherits its rotations from the elbow and shoulder joints, so we don't have complete control over it. Forcing it to follow the rotation on this new joint, which has no influences, will free up the control wrist's movement and allow us to pose it freely.

4.

Select L_ConHand followed by L_ConWrist, and go to Constrain > Orient; your previous options should have been stored.

5.

Select L_ConWrist followed by L_ConHand, and go to Constrain > Point to lock the new wrist control's translations to the old wrist controller.

The wrist is now free from the forearm, so go ahead and apply this to the right arm. Then add the same controls to Grae.

Finger Controls

Animating the hands can be a time-consuming job, so we want a way around having to rotate each joint separately before setting a key. What we will do next is add controls to the fingers, allowing us to pose them quickly and easily. In this section you'll see how to use time-saving dynamic attributes, mentioned earlier in this chapter.

NOTE

The next two sections cover advanced character-rigging tasks. You may find that you don't need to animate the hands on your character, or the animators on your team may prefer to animate the joints directly. Feel free to skip this entire section on finger controls if you don't need it.


Adding Quick Poses

Using the new hand-control joint we created in the preceding section, we can add extra dynamic attributes that, once configured, will automatically pose the hand.

Attributes are built into every object. Up to now you have used the primary Translate, Rotate, and Scale attributes, which control an object's movement, orientation, and scale. You know that changing the value of an attribute has an effect on the object. In addition to these default attributes, user-added dynamic attributes can control a number of characteristics on an object, or even on a completely different object.

Let's now add some dynamic attributes to Kila's control hand joints.

1.

Select both the left and right hand controls (L_ConHand and R_ConHand), and go to Modify > Add Attribute. The Add Attribute dialog box illustrated in Figure 12.21 appears. This is where you will add a new attribute to the selected objects.

Figure 12.21. Add Attribute dialog box


Dynamic Attribute option

The following options under Modify > Add Attribute are available for creating dynamic attributes:

  • Attribute Name allows you to give the new attribute you are creating a name. This should be a descriptive name that represents what the attribute is created to do.

  • Make Attribute Keyable, when enabled, means the attribute can be animated.

  • The Data Type is where you specify what sort of attribute you are creating:

    Vector will give you three floating-point (integer or decimal point) values. So an attribute named Fist would end up with three attributes called Fist X, Fist Y, and Fist Z.

    Float sets the attribute to be a single floating-point value.

    Integer forces the attribute to accept only whole numerical values.

    Boolean creates a simple on/off switch.

    String creates an attribute that can hold a text string.

    Enum gives the user a list of choices, which you specify in the Enum Names box at the bottom of the Add Attribute dialog box.

  • In the Numerical Attribute Properties section, you can lock your attributes so they have a maximum and minimum value.


2.

Let's now create our first attribute, called Fist. You only need a numerical value, so set the Data Type to Float (the default).

3.

Clamp the attribute's values by setting Minimum to 0 and Maximum to 10 in the Numerical Attribute Properties section.

4.

Click Add, and the new attribute will appear in the Channel Box (after Visibility, as seen in Figure 12.22).

Figure 12.22. Add Fist, Curl, Point, and Splay attributes to the wrist joints.


5.

Repeat steps 2 through 4 to add attributes called Curl, Point, and Splay (Figure 12.22).

With these dynamic attributes added to the wrists, we next need to wire them up to the fingers. To do this, we will use the Set Driven Keys options (Animate > Set Driven Key > Set).

Set Driven Keys links one attribute to another (on the same object or a different one) using key frames. Unlike normal keys in Maya, driven keys are not set at specific times in the time slider; rather, they are set at specific values on another attribute. For example, the character's hand will be in its default pose when the Fist attribute is at 0. Change the Fist attribute to 10, and you will see the hand change into the fist pose. This is because driven keys have been placed on the hand for when the fist attribute is at 0 and 10.

Let's now apply this technique to our character's hand.

1.

Open the Set Driven Key dialog box (Figure 12.23, left) by going to Animate > Set Driven Key > Set and opening the options box. You will work on the Fist and Point attributes first, since these finger poses are similar.

Figure 12.23. The Set Driven Key window before and after the attributes are selected


2.

Select the L_ConHand joint. In the Set Driven Key dialog box, click on the Load Driver button. On the left side of the Driver box, the name of the object will appear, with all its keyable attributes in the box to the right. From this list, select Fist.

3.

Next, select each finger joint except for the very end ones, and click Load Driven. In the Driven box, the names of all the finger joints will appear; select them all. Then, in the list on the right side of the Driven box, select the rotateX, rotateY, and rotateZ attributes (you only need to store the rotations).

Your Set Driven Key window should now look like that in Figure 12.23, right.

What we've just done is tell Maya that we want the Fist attribute to drive the finger joints' rotations. Now we will define the start and end poses associated with each attribute (Fist, Curl, Point, and Splay). First we will store the default pose into each of the four dynamic attributes.

NOTE

Make sure all four of the dynamic attributes are set to 0. To do this, select L_ConHand in the Driver panel of the Set Driven Key dialog box. This will quickly select the object so that you can check the attribute settings.


4.

In the Driver box, select Fist and then click Key. Continue, selecting Curl, Point, and then Splay, before clicking Key for each one.

The current hand's pose is now stored, so that when each attribute is at 0, the hand will be at this default pose.

5.

With the Set Driven Key window still open, set the Fist and Point attributes to 10. (Don't set a key yet, though.)

6.

Adjust the finger joints to form a fist (Figure 12.24b).

Figure 12.24. Create the four hand poses for Fist, Point, Curl, and Splay.


TIP

Set the joint display size so the joints are the same thickness as the geometry for the fingers. This will give you a better idea of how the fingers will look as you pose them.

7.

Select Fist in the Driven box and click Key. Then select Point and click Key. Now if you adjust the Fist or Point attribute on L_ConHand, the fingers will animate to form a fist.

To get the point, set Fist back to 0 and Point to 10 so it makes the fist; then edit the index finger so it points (Figure 12.24c). To update the pose, select Point in the Driven box and click Key.

8.

Next we will work on the Curl. Make sure all the attributes are back to zero; then set Curl to 10.

9.

Adjust the fingers as seen in Figure 12.24d, rotating just the end joints of the fingers. Then select Curl in the Driver box and click Key.

10.

Finally, create the pose for Splay (Figure 12.24e). Remember to set all the attributes back to 0 and Splay to 10 before you begin to pose the fingers.

Now we have the ability to get quick poses on Kila's hands. You may need more specific poses for your game; perhaps the character holds a gun or operates some kind of machinery. Now that you have learned the dynamic attributes technique, you will be able to add more poses if you need them.

TIP

To help create poses for the right hand, I have included a small tool on the GCDM shelf labeled mirPo. This tool mirrors the pose from one side of the skeleton to the other, in this instance saving you the effort of re-posing the right hand. Just get the left hand into its pose, select the wrist joint on the main skeleton (not the control wrist), and click the mirPo button. The right hand will now adopt the same pose.


The key poses are an excellent way to achieve quick animations. Now you need to add the ability to animate the fingers individually; we'll tackle that next.

Full Animation of the Fingers

The quick hand poses are normally all you will need for in-game animation. The problem facing you now is that you can't edit the fingers individually because they are locked by the driven keys. We will now add full animation functionality back into the hands.

NOTE

Before you implement full animation into your rig, check with your manager; it may be that you don't need these controls and so don't need to spend time implementing them.


1.

Import the icon file named Icon_Hand.mb. This contains a group called LeftHand, which contains individual finger icons.

2.

Snap the main LeftHand group to the left wrist joint by holding V, and adjust the overall scale so it matches the size of the hand joints (Figure 12.25).

Figure 12.25. Import and position the hand icon.


3.

Freeze the transforms.

NOTE

The hand icon group's main pivot exists below the actual icons themselves. This is so the icons can stay out of the geometry while also being locked to the wrist's position.

TIP

You may want to turn off the Rig_Controls display layer so that you can concentrate on the hand itself.

4.

We want the hand icon to stay locked to the wrist as it moves. Select the control wrist first, and then the main hand icon group (LeftHand). Then go to Constrain > Point, making sure Maintain Offset is disabled.

Now we will start to wire the fingers up using Set Driven Keys. Since the process for connecting each finger is the same, we will describe the process for connecting the little finger (pinkie); then you can apply the same technique to the rest of the fingers.

1.

Go to Animate > Set Driven Key > Set and open the options box.

2.

Select the icon for the pinkie finger. Then click Load Driver in the Set Driven Key window. You will notice that I have already added a series of dynamic attributes for you, so you should not need to add any.

3.

Select each joint of the pinkie finger, leaving the end one unselected, and click Load Driven. The three separate Pitch attributes (Proximal_Pitch, Middle_Pitch, and Distal_Pitch) correspond to each individual finger joint, so you only need to set keys for these attributes.

NOTE

When you work on Grae, remember that he only has two joints in each finger. That means you can ignore his Distal_Pitch attributes.

4.

Store the finger in its base pose by first selecting the Proximal_Pitch attribute, and then just the L_Pinkie_A's rotateZ attribute (Figure 12.26). Then click the Key button. (We only need to work on the Z rotation because it's all that is needed to bend the finger.)

Figure 12.26. Select just the Proximal_Pitch and the L_Pinkie_A's rotateZ attributes.


5.

Select the Middle_Pitch and the L_Pinkie_B's rotateZ attributes, and set a key.

6.

Finally, select Distal_Pitch and the L_Pinkie_C's rotateZ attributes, and set a key.

With the default pose stored, we can now begin to store the finger's maximum rotations.

1.

Set each of the Pitch attributes (Proximal_Pitch, Middle_Pitch, and Distal_Pitch) to 5.

2.

Bend the finger back, using only the Z rotation (Figure 12.27, middle).

Figure 12.27. Take the finger to both extremes and store each pose.


NOTE

Setting Kila's joints to about 30 (and 50 for Grae) will bend the finger back farther than it naturally could go, but we need to give the animators some flexibility. And we will also want to apply the same rotations to the other fingers. So keeping this to a nice round number makes the value easier to remember.

3.

With the finger in position, set a key on the three Pitch attributes, remembering to select only the corresponding joint in the Driven window.

4.

You will now take the finger to the next extreme, so first set the Pitch attributes to their maximum of 10.

5.

Rotate the finger around the Z rotation to 80 (Figure 12.27, right) and set a key on each Pitch attribute in the Set Driven Key dialog box.

Now as you move the three Pitch attributes in the Channel Box, the finger will quite happily bend. We still need to add lateral movement to the finger; this movement, however, will be restricted to the knuckle (Proximal) joint.

1.

Select the first joint of the pinkie, and reload it into the Driven section of the Set Driven Key dialog box.

2.

To get the finger to spread, we need it to rotate around the Y axis, so select rotateY in the right side of the Driven box. Make sure the joint's Y rotation and Proximal_Yaw are set to 0. Then set a key.

3.

Set Proximal_Yaw to 10, and the finger's Y rotation to 25. Set another key to define this pose (Figure 12.28, middle).

Figure 12.28. Using the Y rotation, store the fingers' spread.


4.

Finally, set Proximal_Yaw to 10 and the pinkie's knuckle joint to 25, setting one final key to define this second extreme (Figure 12.28, right).

To complete the finger setup, we need to allow for the finger to roll, rotating around the X axis.

1.

Set the base pose, with both the Proximal_Roll and L_Pinkie_A's rotateX attributes set to 0.

2.

Set Proximal_Roll to 10. Then set the finger to one extreme by rotating the X rotation to 30. Set a key.

3.

Set the final key by defining the next extreme, setting Proximal_Roll to 10, and then the finger's X rotation to 30.

The pinkie is now fully posable; continue setting up the rest of the fingers for the left hand, using exactly the same values as we have established for the pinkie finger.

When all the fingers are set, import a second hand icon (or duplicate the first), remembering to rename the main group and the individual elements so they represent the right hand. Follow the same procedure to wire up the fingers on the right hand, but this time make the values negative (for instance, 30 should be 30). This allows the fingers to move in the same way as those on the opposite hand, making them easier to animate and transfer animation if needed.

We now have the ability to quickly pose the fingers as well as animate them individually; the arms and hands are fully rigged (Figure 12.29). Now would be a good time to save your work, naming it Kila_ArmRig.mb.

Figure 12.29. Kila's arms, fully rigged


When you're ready, start at the top and follow the instructions in this section to rig Grae's arms and hands. Save him as Grae_ArmRig.mb.



    Game Character Development with Maya
    Game Character Development with Maya
    ISBN: 073571438X
    EAN: 2147483647
    Year: 2004
    Pages: 169
    Authors: Antony Ward

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net