Inverse Kinematics
For goal-oriented motions, such as having a character plant her feet on the ground or reach out her hands and open a door, you need to animate using Inverse Kinematics (IK).
Inverse Kinematics involves IK handles and IK solvers. An IK handle runs through the joints being affected. The joints being affected are called the IK chain, and a handle wire runs through them. A handle vector starts from the start joint and finishes at the end joint, where the IK handlers end effector is located.
Hai>dla Wit Handle End Effecior
(or Ownon)
Hai>dla Wit Handle End Effecior
(or Ownon)
ikSC Handle
An IK solver looks at the position of the end effector of an IK chain and performs the necessary calculations to make the joints rotate properly, from the start joint to the end joint of the IK chain, in such a way that the end joint will be where the end effector is. When the end effector moves, the IK solver converts the translation values of the end effector to the rotation values for the joints, and the joints update accordingly.
Mayans interface has three kinds of IK solvers: the ikRP (Rotate Plane) solver, the ikSC (Single Chain) solver, and the IK Spline solver. Each type of IK solver has its own type of IK handle.
Using the ikRP Handle
Since the ikRP solver is the default setting for the IK Handle tool, letns see how that works first. In the side view, draw a simple joint chain (as in the inset on the upper left shown below). Select Skeleton > IK Handle Tool >, and reset the tool to its default settings. Click on the first joint, then click on the last joint. You should see that an IK handle has been created. The circle at the top looks complicated (as in the inset below), but itns actually a fairly simple setup, once youDve learned what its components are.
- ifcliP Handle
The ikRP solver calculates only the positional value of the end effector, which means it ignores the rotational values of the end effector. The joints are rotated by the ikRP solver in such way that their Y axes are planar, their X axes are pointing to the center of the bones, and their Z axes are perpendicular to the bending direction. This is the default local orientation set up for joints. If you do not see the rotate disc, select the end effector and press the T key to display the Show Manipulator tool.
The plane along which the joints are bending is represented by the plane indicator. The plane itself is called the joint chain plane. You can rotate this plane about the handle vector using the twist disc, which rotates the IK chain. The Twist degree is measured relative to a reference plane created by the handle vector and the pole vector, which can be translated and keyframed.
Warning At times, the way you want the arm to bend will cause the IK chain to flip with the default reference plane setting. To avoid this flipping, adjust or animate the pole vector.
Open the Attribute Editor for the ikRP handle. The Snap, Stickiness, and Solver Enable settings are discussed in the ^Switching between Inverse and Forward KinematicsD section, following the discussion of the ikSC handle.
The advantage of using the ikRP handle over the ikSC handle, discussed next, is that you can get more precise control over the rotation of the IK chain. The disadvantage is that it necessarily has more components to deal with.
Using the ikSC Handle
The ikSC handle is simpler than the ikRP handle. To experiment with it, go to the side view and draw another simple joint chain. Select Skeleton > IK Handle Tool > as before, but this time, select the ikSC solver setting, then close the option box. Click on the first joint, then click on the last joint, and you will see the ikSC handle.
If you press T to display the Show Manipulator tool, you will see nothing, because there are no extra manipulators for the ikSC handlen everything is controlled by the end effector.
Select Rotate and try rotating the end effector. You will notice that only the local X and Y rotate handles seem to have any effect, and that they snap back to certain angles after you release the handles. The ikSC solver calculates the rotational values of the end effector and rotates the IK chain in such way that all the joints in the chain will have the default local orientation for joints. The joint chain plane exists in the ikSC solver, although you do not see any representation of it in the handle.
Open the Attribute Editor for the ikSC handle. The ikSC handles can have a Priority assignment when there are two or more chains overlapping. The handle with the Priority 1 setting will rotate the joints in its chain first, next the handle with the Priority 2 setting will rotate its joints, and so on. The Po Weight setting determines the handlers position/orientation weight. If the weight is 1, then the end effector will try to reach only the handlers position; if the weight is 0, the end effector will try to reach only the handlers orientation. You should leave this setting at the default value of 1. The Snap, Stickiness, and Solver Enable settings are discussed in the next section.
The advantage of using the ikSC handle is that you only need to use the end effector to control the IK chain. For situations where you do not need a great amount of IK chain rotations, this would be the more economical method of animating.
Tip When you are using the ikSC handle to rotate IK chains, use the Graph Editor to interactively adjust the rotational values. It produces most predictable results. See Chapter 10 for more information about the Graph Editor.
Switching between Inverse and Forward Kinematics
Maya allows you to switch back and forth between using ikRP or ikSC handles and rotating joints (forward kinetics). Itns easy to do, and you may find it useful. Letns go through the technique using the ikSC handle we created in the previous section.
- Go to frame 1 and turn on Auto Key. Without this setting, the process becomes cumbersome.
- Keyframe the end effector, move to frame 10, and translate the end effector. You should have another keyframe automatically set.
- In the Attribute Editor, turn off Solver Enable to locally turn off the ikSC solver for this handle.
- Select the two joints in the IK chain and keyframe them. Go to frame 20 and rotate the joints. Go to frame 30 and repeat the action.
- Select the ikSC handle again. In the Attribute Editor, turn on Solver Enable to turn on the ikSC solver. You will find that the end effector acquired the keyframes for frame 20 and 30 in the same positions where the joints were keyframed.
In order for this switch to be possible, you need to have the end effectorns Snap setting on and Stickiness off in the Attribute Editor. If Snap is off or Stickiness is on, then the end effector will not snap to the end joint when the joints are rotated.
One more thing to be aware of in switching back and forth between inverse and forward kinetics is that the movements generated by the rotation of the joints and the corresponding keyframes of the end effector will not always match. They will roughly be the same, but you may need to tweak the end effectorns animation.
Using the IK Spline Handle
While the ikRP and ikSC handles are similar in their attributes, the IK Spline handle is quite different in the way that it functions. The IK Spline solver takes a NURBS curve as part of its handle and rotates the IK chain to follow the shape of the curve. The CVs of the NURBS curve, rather than the end effector of the handle, are animated. The IK Spline handle is ideal for animating curvy or twisty shapes, such as tails, spines, snakes, or tentacles. Letns try out this last type of IK handle.
1. In the side view, build a joint chain, as shown below. For IK Spline handles, the joints need not be built at an angle, but the bones should be short to ensure the chain will move smoothly.
- IK Spline Handle
- Select Skeleton > IK Spline Handle Tool > and check Number of Spans 4. Leave the other options set to their defaults and close the option box.
- Click on the top joint, then click on the last joint, and you will see the IK Spline handle.
- In the Outliner, select the joint chain or the IK handle and try moving the joints. The joints have become attached to the curve, and the IK handle doesnnt show a manipulator.
- Display the CVs and move them around, as shown below.
Note You can also create your own NURBS curve and have the IK Spline handle use that curve. Turn off the Auto Create Curve setting in the IK Spline Handle option box. Click on the root joint, the end joint, and then the curve to create the IK Spline handle.
6. Open the Attribute Editor for the IK handle. YouDll see the regular attributes and some specifically for the IK Spline handle. Try typing in numbers for the Offset, Roll, and Twist settings.
Offset translates the joint chain along the curve, with 0.0 as the start of the curve and 1.0 as its end. Roll rotates the whole joint chain. Twist gradually twists the chain from the second joint on. If the Root Twist Mode is turned on, then the twist begins from the root joint. The Root on Curve setting constrains the root joint to the start of the curve. Turn it off, and you can move the root joint off the curve, but note that it is still constrained to the curve.
As we have seen, skeletons can be moved and rotated with Forward Kinematics or Inverse Kinematics to animate various parts of a character. In addition to the IK tools, Maya provides the Constrain menu in the Animation module. The functions in this menu are often used in conjunction with the IK tools to set up a character for animation. - - "
Books24x7.com, Inc. © 2000 - Feedback


Mastering MAYA Complete 2
Chapter 11 - Paths and Bones
Mastering MAYA Complete 2
Perry Harovas, John Kundert-Gibbs and Peter Lee
Copyright © 2000 SYBEX, Inc.
Post a comment