Drawing Skeletons in Maya
Skeletons are a special kind of deformer found in the Animation module (press F2) and are specifically designed for animating characters. Like other deformers, skeletons affect the component structure of your models. By assigning and animating the skeletons, vertices on the skin move, and your character models change shape over time. Skeletons usually have length, which you create by drawing a skeleton from point A to point B. Most skeletons have at least two joints: a root joint and an end joint. A bone connects each joint. Although you can create single-joint skeletons, multiple-joint skeletons are most common in characters.
The most basic way to manipulate skeletons is to rotate their joints, which is called Forward Kinematics (FK) (see Figure 1). It is not desirable to translate any joints other than the root joint. Translating a joint in the skeleton chain causes the previous joint's center to no longer be oriented down the length of the bone, which can cause rotation problems on your controls. By rotating the joints, you can avoid this problem. Rotating the joints also enables you to animate the skeletons to bend in any direction. As the name implies, you animate with FK by starting at the root joint, and progressively rotate each joint down the skeleton chain.
Figure 1 The most basic way to animate a skeleton, called Forward Kinematics, is to rotate the joints.
The other way to manipulate skeletons is to use Inverse Kinematics (IK), which constrains the skeleton to bend in a single direction by assigning it an IK solver. You manipulate the skeleton by translating an IK handle, which is created when you assign the solver. Translating the handle causes all the joints to rotate that are constrained by the solver. Usually the IK handle is on the last joint in the skeleton chain, so that translating it affects the joints higher up in the chainhence the name Inverse Kinematics.
Understanding skeletons is important if you want to create effective character controls. If you display the center on a skeleton joint by choosing Display, Component Display, Local Rotation, notice that the local center of a joint is not set to the global orientation. When using the default joint creation settings, the X-axis always points down the bone to the next joint (see Figure 2), enabling you to rotate easily around a joint's local center to twist a bone. You will want to do this in several parts of your character (to make a forearm twist, for example). Also notice that the Z-axis points toward you in the view in which you created the skeleton, because the Z-axis is the preferred rotation axis if IK is attached to the skeleton.
Figure 2 The default orientation of joints has the local X-axis pointing toward the next joint in the skeleton chain.
You can set the skeleton joint creation options to create IK automatically when you draw a skeleton, or you can add the IK manually after you have drawn the skeleton. In either case, draw your skeletons in a particular way when you know they will be constrained with an IK solver. IK bends in only one direction, which is based on the preferred angle of the joints. The preferred angle is the direction the joints are pointing when they are initially drawn. Draw your leg skeletons in the side view with a slight bend toward the front of the knees, for instance, to ensure that they have the correct preferred angle when their IK is activated (see Figure 3). Usually this requires you to draw the skeletons in a particular orthographic view, which is perpendicular to the axis that the joint should rotate in. The main axis of rotation on a normal IK skeleton is always the Z-axis.
Figure 3 Draw the IK leg skeletons with a slight bend toward the front of the knee to set the preferred angle.
There are some obvious advantages and disadvantages to using IK or FK on your skeletons. One advantage of IK is that it is faster to set and edit translation keys on a single IK handle, than to set and edit rotation keys on multiple joints. It also is easier to target the end of a limb in 3D space when you are animating (to make the feet target the floor, for instance). On the other hand, IK is constrained to bend in only one direction, whereas FK can bend in any direction. This makes IK more suitable for hinge joints, such as the elbows and knees. FK, on the other hand, is more suitable for joints that move more like ball joints, such as the backbone vertebrae.
Another limitation of IK is that all the joints in a solver move when the IK handle is animated, making it impossible to isolate the rotation of a single joint in the chain. You must be able to rotate a child joint without rotating the parent if you want to create a swinging-type motion on the arms or legs (see Figure 4). This motion type usually occurs only as an unconscious movement while walking, throwing, or kicking. Because many limb motions are conscious, however, it is still better to use IK on the arms and legs most of the time. For the times when you need to create a swinging motion, however, you must have controls for switching between IK and FK in the middle of your animation.
Figure 4 A swinging motion on the limb joints is not possible when IK is constraining a skeleton.
All the tools for drawing skeletons and creating IK are under the Skeleton menu in the Animation module. Before you create a skeleton, check the settings in the Joint Tool options box by choosing Skeleton, Joint Tool . Here you can constrain a skeleton to rotate in a specific way, by turning off the Degrees of Freedom for a particular axis. You also can change the way Maya orients the local centers on joints by setting the Auto Joint Orient to something other than XYZ. For most skeletons, however, it is best to use the default settings. The only setting you will frequently change is the Create IK Handle option (see Figure 4.5).
Figure 5 Open the Joint Tool options box to turn on or off the automatic creation of an IK handle on a skeleton.
You can add IK to your skeleton automatically when you draw it, or you can add it later after you draw the skeleton by choosing IK Handle Tool in the Skeletons menu. The available options are the same in either case. The main difference is that IK, if added automatically, always constrains the entire skeleton with the solver; if added manually, however, IK enables you to specify what joints will be constrained. You also can add more than one IK handle to different parts of the same skeleton if you add the IK manually. Like the joint options, you usually use the default IK handle option settings. Keep in mind that you also can adjust most of the joint and IK handle options in the Attribute Editor after you create a joint or IK handle.
One IK handle option you will occasionally change is whether the current solver is a Single Chain (SC) or a Rotate Plane (RP) solver. The difference between these two solvers is how they control the overall twist orientation of the skeleton. The SC solver forces the skeleton to twist when the IK handle is rotated. The RP solver, on the other hand, has a separate twist channel for twisting the skeleton, and the IK handle affects the skeleton only through translation (see Figure 6). You get more flexibility by separating the Twist attribute from the Rotation attributes of the IK handle, and the separation enables you to control the twist channel with a separate object by using a pole vector constraint. Because of this, you will be using an RP solver most of the time. The arms and leg skeletons of your character, for instance, will use RP solvers so that you can control where the elbows and knees point by using pole vector constraints.
Figure 6 When you create an IK handle with an RP solver, a separate twist channel controls the overall orientation of the skeleton.
When drawing skeletons, it is best to click and drag with the left mouse button held down. This action enables you to place joints precisely while drawing them. Correct placement is important, because modifying skeletons after they have been drawn creates values in the joint's rotation channels, which can be undesirable. If you place a joint in the wrong place while drawing the skeleton, you can press the Z key to undo, and proceed to redraw the joint. When all the joints are drawn, press the Enter key to set the skeleton.
One thing to consider when drawing skeletons is whether you want to attach multiple branches to a single joint. Do this by first clicking a joint within an already existing skeleton when drawing a new skeleton. When you finish drawing the new branch, notice that rotating the joint you clicked rotates both branches together (see Figure 7). This joint rotation occurs because the two joints have merged into one joint. Although you can create an entire character skeleton as one piece this way, this method provides limited flexibility for animation because it prevents you from being able to animate branches separately from each other.
Figure 7 Attaching two skeletons creates a single parent joint for two separate branches. You cannot rotate the two branches separately from one another.
Instead of attaching skeleton branches, draw the joints separately, and parent the branches to a single joint or control object. Doing this enables you to animate the branches together by animating the parent object, or separately by animating the child joints, giving you more flexibility when animating. To draw a skeleton branch so that it starts on a joint but is not attached to the joint, avoid directly clicking the already existing joint. Instead, after clicking, drag the new joint on top of the previously created joint, and continue drawing the branch. You can then parent the joints under a control object or group node.
When parenting joints, notice that a bone is always drawn between the parent joint and the root joint of the branch. Keep in mind this can sometimes clutter your interface with crisscrossing joints on a complex skeleton. To keep this from happening, you have to put two group nodes between the joints. Do this by parenting the two joints, and then select the child root joint and press Ctrl+G twice. After doing this, notice that the connecting bone disappears. Also be aware that this hasn't changed the functionality of the skeletons.
Getting your skeletons drawn is just the beginning of getting a good character rig created. But doing it right at this point will make for less work and greater functionality later on.