Demo Outline 6: IK handles and solvers
In Maya using with inverse kinematics involves using tools called "IK
handles" that pose joint chains. The effect of the IK handle on
the joint chain depends on the type of IK solver the IK handle
is using.
Maya provides three types of IK handles:
Single Chain handle, Rotate Plane handle, and Spline handle. Each type of IK
handle uses a different type of IK solver.
Single Chain (SC) Handle and Rotate Plane (RP) Handle can be
used to animate the motion of an articulated figure's limbs, and similar
objects.
The difference between an IK SC handle
and an IK RP handle is that:
- IK SC handle's end effector tries
to reach the position and the orientation of its IK handle.
- IK RP handle's end effector only
tries to reach the position of its IK handle.
Because the IK RP handle's end effector
only tries to reach the position, the resulting joint rotations are more predictable.
To control orientation of IK RP handle, you can rotate the pole vector or twist
disc.
Spline Handle can be used to animate the motion of curvy or
twisty shapes, such as tails, necks, spines, tentacles, bull-whips, and snakes.
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 control vertices (CVs) of the
curve, rather than the end effector of the handle, are animated.
To set up a SC handle:
- Go to Animation Menu Set (F2).
- Select Skeleton -> Joint Tool.
- Create three joints in the front
view. Two bones are automatically created to connect three joints. Hit "Enter"
to get out of Joint Tool.
Notes:
- If you select the root joint and
move it using Move Tool, the other two joints lower in the hierarchy follow.
If you select the middle joint and move it, the last joint moves with it.
Select a joint and hit "Insert", then you can move the joint alone
without moving the joint(s) lower in the hierarchy until you hit "insert"
again.
- You can move along the hierarch
using arrow keys
- Open IK Handle Tool's
settings by selecting the small square box next to Skeleton -> IK Handle
Tool. Select ikSCsolver as Current Solver.
- Select the root joint and Shift-select
the third joint with the left mouse button (LMB). You should see the line
connecting the root and third joint appear.
- Open Hypergraph. You should see
a red dotted line connecting "joint1" (the root joint) and "effector1",
and also ikHandle1.
- To pose, select "ikHandle1"
and move it. DO NOT MOVE ANY JOINT in order to pose the chain.
- If you want to move the joint
chain and its IK Handle together, you may group them together.
- Rename all the joints and ikHandle
with descriptive names.
A problem with the SC Handle is that
you don't have much control over the rotation of the middle joint, i.e., in
which direction the chain bents at the middle joint.
To set up a RP handle:
- Select Skeleton -> Joint Tool.
- Create another set of three joints
in the front view. (You should see "joint4", "joint5",
and "joint6" appear in Hypergraph.) Two bones are automatically
created to connect three joints. Hit "Enter" to get out of Joint
Tool.
- Open IK Handle Tool's settings
by selecting the small square box next to Skeleton -> IK Handle Tool. Select
ikRPsolver as Current Solver.
- Select the root joint and Shift-select
the third joint with LMB. You should see the line connecting the root and
third joint appear.
- Open Hypergraph. You should see
a red dotted line connecting "joint4" (the root joint) and "effector2",
and also ikHandle2.
- To pose, select "ikHandle2"
and move it. DO NOT MOVE ANY JOINT in order to pose the chain.
- To change the rotation of the
middle joint, you can change the direction of Pole vector
OR change Twist parameter value.
- To manipulate Pole vector interactively,
select Show Manipulator Tool under Move Tool, move the line with one end attached
to the root joint. (The other rend has a square box around it.) The line represents
Pole vector.
- To change Twist value interactively,
select Show Manipulator Tool under Move Tool, and drag along the yellow circle
around the third joint with the left mouse button down.
- If you want to move the joint
chain and its IK Handle together, you may group them together.
- Rename all the joints and ikHandle
with descriptive names.
Two vectors, Pole vector and Handle
vector (the vector from the root joint to the last joint in the IK chain), define
the plane in which the middle joints lie on. When either one of the vector loses
its length or when the two vectors are parallel (e.g, when Pole vector crosses
Handle vector), the plane cannot be defined. As the result, the joint chain
may "flip" (i.e., bend to an opposite direction suddenly). When you
joint chan flips, correct the problem by moving Pole vector away from Handle
vector and by not letting Pole vector crosses Handle vector.
Pole vector and Twist are independent parameters that control the rotation(s)
of the middle joint(s). If you animate both of them simultaneously and if the
joint flipping problem (described above) happens, it will be hard to correct
the problem. Use Pole Vector to set up desired joint rotations (i.e., the direction
the chain bends) and use Twist for fine tuning or animating detailed motion
(e.g. a knee shaking).
To make it easier to select the IK handle:
- Select the IK handle. Select Display
-> Component Display -> Selection Handles.
- Press F8 to go into Component
mode.
- Turn off the Point selection mask
and turn on the handles selection mask.
- Click-drag a selection box around
the IK's selection handle to select it.
- Move the handle so that it does
not lie in the skeleton.
- Press F8 to go back to Object
mode.
To make it possible to manipulate
Pole Vector without Manipulator Tool:
- Create -> Locator. Move it
near the middle joint.
- Select the locator and Modify
-> Freeze Transformations.
- Select the locator and Shift-select
the IK handle. Select Constrain -> Pole Vector.
- Rename the locator appropriately.
To set up a Spline Handle:
- Select Skeleton -> Joint Tool.
- Create a set of joints in "S"
shape in the front view. Hit "Enter" to get out of Joint Tool.
- Select Skeleton -> IK Spline
Handle Tool. Click on the first joint and the last joint. You should see the
line connecting the first and last joint appear.
- Open Hypergraph. You should see
a red dotted line connecting the root joint and the end effector, the IK handle,
and "curve1".
- To pose, select "curve1"
and select "Select by component type", and move the control vertices
(CVs) of "curve1".
In order you to move the CVs without
going into Component mode (i.e., staying in Object mode), you can do the following:
- Select the curve that is used
for a Spline Handle.
- Select
the box next to Deform -> Create Cluster. Select Relative as Mode.
- Select "Select by component
type" or press F8 to go into Component mode.
- Select one CV of the curve. Select
Deform -> Create Cluster. "C" should appear at the CV.
- Repeat 4 for each CV.
- Go back to Object mode by selecting
"Select by object type" or pressing F8. Now you can select and move
each CV without going to Component mode.
To do Assignment 2:
Use skeleton.mb in \\ebony\workspace\AC750_Kitagawa_Fall_2003\maya.
Follow the instructions below.
- To move the character, select
back_root_X and move it. The entire body moves but the feet
and hands are left behind.
- To move the right arm, select
R_wrist_locator_X and move it.
- To rotate the right arm (i.e,
to move the right elbow), select R_elbow_PV_X and MOVE it.
- To move the right hand, select
R_hand_IK_X and move it.
- To rotate the right hand, select
R_hand_PV_X and MOVE it.
- To move the right leg, select
R_foot_X and move it.
- To rotate the right leg (i.e.,
to move the right knee), select R_leg_PV_X and MOVE it.
- To roll the right foot, select
R_foot_X and change Roll parameter value.
- To pose the spine, select spine_cluster_A_X,
spine_cluster_B_X, and spine_cluster_C_X
and move them.
- To rotate the head, select back_neck_joint_X
and ROTATE it. (Forward kinematics is used here.)
Notes:
- Notice that all the items you
need to animate have the names that end with _X.
- Have a plane to indicate the position
of the ground and make sure that the feet do not slide.
- To hide the skin and see the skeleton
alone, go to Layer Editor under Channel Box and click the box with "V"
in it. (V stands for visibility for "skin_layer" that contains the
skin.) Click the box will display the skin again.