[WML-Source: Ika.wml][TOC][Part00]

[chapter]

[section]IKA and Skeletons by Reevan McKay

[subsection]Setting up Character Animation

In this tutorial we will walk through the steps involved in preparing a character model for animation. This involves adding the bones and controls that will be used to deform the mesh.

You can either use a character of your own, or you can load the "KNIGHT.BLEND" file from the CD-ROM.

When designing your character, model it up so that the arms are stretched out to the sides, with the palms facing down.  The legs should be straight with the feet flat on the floor (Fig. 1).

Figure 1  [images/Ika/notes3.tga]

There are three main sets of components involved in the character animation setup process.  The mesh, the skeleton, and the controls.

The mesh is the actual model geometry that is rendered.  The mesh is deformed by the skeleton that is composed of the IKAs and Empties that define the deformation envelope.  To simplify the animation process, the skeleton is often manipulated indirectly with a series of control objects.

It is a good idea to separate the different objects involved into the animation onto layers based on their functions.  Consider the following layout for example:
  • Deformed Mesh Layer
  • Reference Mesh Layer
  • Primary IKA skeleton
  • Secondary IKA elements (bones that are a part of the control system but which do not directly contribute to the skeleton's deformation)
  • Control Empties / Effector targets
  • Deformation objects

This makes it easy to show or hide layers to reveal just the mesh or the skeleton, to easily locate the control empties or to hide the deformation objects.  Depending on the complexity of your skeletal system you may want more or fewer layers.  Putting a character's finger IKAs on a layer of their own would it much easier to select and focus on the small bones without accidentally selecting items in the rest of the character's skeleton.

[subsection]Working with IKAs

[point] IK vs. FK

The TAB key toggles IKA chains between Forward Kinematics (FK) and Inverse Kinematics (IK) mode.  In FK mode, manipulating the IKA chain affects the root, or base of the system.  In IK mode, the end or effector is controlled.  Once the effector has been placed, the IKA chain will constantly try and adjust itself to that it touches the effector.  You can tell which mode is active by looking at the position of the yellow dot present on the chain when it is selected.  If the dot is at the base, the IKA is in FK mode.  If it is at the tip, the limb is in IK mode.

In a character setup, most of the major IKA chains will be left in IK mode.
Note: you cannot toggle between IK mode and FK mode in the course of an animation.

[point]Effector Parents

Unlike other objects in Blender, IKA chains can have two parents.  In addition to normal parenting relationship, an IKA can have an effector parent.  An IKA chain with an effector parent will attempt to solve itself so that the tip of the chain touches the parent.  If this can't be done -- if, for example the effector parent (or target) is too far away to reach -- the solver tries to get as close as possible.  Note that moving the effector parent will never change the position of the start of the chain (Fig. 2).

Though it is possible to directly manipulate the location of an IKA chain's effector, it is often better to use an empty as an effector parent and move that instead.  This way it is possible to see where the IKA chain is trying to go, and to set targets that would not normally be reachable by an IKA chain (such as having a character's arms stretch out to touch an object that is out of reach).

When making another object the parent of an IKA chain, a requestor will appear with the message EFFECTOR AS CHILD?  To designate the object as an effector parent, click on the message, or press ENTER . To dismiss the requestor (and therefore set up a normal parenting relationship), press ESC or move the mouse away from the requestor.

Note that effector parents only have an effect if the chain is set to IK mode.

Figure 2  [images/Ika/notes5.tga]

[point]360 Degree Joints

IKA chains in Blender are essentially two-dimensional.  Though it is possible to rotate them a bit, there are usually problems when the effector target is moved out of the IKA's plane.  This makes true 360 degree joints difficult to simulate.

To solve this problem, we place an extra bone at the root of the main chain with the same facing, but rolled 90 degrees.  This new IKA becomes the child of the main chain's root, and becomes the limb-parent to the main chain (Fig. 3).

Both the chain and the limb-parent should use the same empty as an effector parent.

This technique works very well for shoulder and hip joints.  If you are going to be rotating an IKA operating in IK mode, you can place an empty at the root of the IKA and make it the parent of the IKA.

Note that when you are building the skeleton, the joint IKAs should not be included in the calculation.

Figure 3  [images/Ika/notes1.tga]

[point]Rolling Controls

Sometimes you may find that the IKA solver leaves your limb in an awkward orientation.  This happens most frequently with the arms.  One way to solve this is to use an empty to control the roll of the limb.

Create an empty and position it at the base of the limb (you can move the cursor to the exact location of the base by selecting the IKA and pressing SHIFT+S >>CURS->SEL. Clear the empty's rotation by pressing ALT+R >>CLEAR ROTATION.  Make this empty the parent of the limb you wish to control, and then make it the child of whatever the limb was attached to.  Fig. 4 shows a rolling empty applied to a 360 degree joint.

When animating using a rolling control, make sure you clear the rotation before setting a new key.  This will help prevent problems such as limbs that twist through impossible angles.

Figure 4  [images/Ika/notes6.tga]

[point]Advanced Rolling Controls

It is possible to roll a single limb in an IKA, rather than the entire chain, though it takes a bit more work to set it up.  This is useful for joints such as elbows (The elbow is responsible for the rotation of the hand: try to rotate your palm while holding your wrist with the other hand).

Start by creating an IKA chain (Fig. 5).  The limb highlighted in green is the limb to which we want to add the roll.

Figure 5  [images/Ika/notes20.tga]

Now add some single-segment IKAs:  one for each limb of the arm chain.  Leave these new segments in FK mode and make the appropriate limbs from the chain the limb-parents of the appropriate segments

Fig. 6 shows the placement of the new bones.  The blue and the green bones are parented to the main chain (represented in grey).  The pink bone is left unparented.

Figure 6  [images/Ika/notes21.tga]

Add an empty at the base of the final segment, and make sure the Z-axis of the empty points along the bone.  Make the empty the limb-child of the final limb of the chain, then make the segment the child of the empty (Fig. 7).

Figure 7  [images/Ika/notes22.tga]

When calculating the skeleton, use the three single segments, rather than the actual arm bone.

Figure 8  [images/Ika/notes23.tga]

To rotate the empty along it's z axis, select it and press KEYPAD* .  This sets the view perpendicular to the object. Rotating the empty in this view will roll the bone along it's length.  To return to the previous view, simply press the appropriate button on the keypad.

[point]Root

The Root is a bone that does not refer to a specific part of the model.  Rather it is used to move the entire model at once, and should be the parent of all of the control empties.  If you wish to scale, move or rotate your character, or to have your character move along a path for example, you only need to operate on the Root bone.

The Root bone is placed at ground level between the character's feet and should be fairly large to easily distinguish it from the rest of the skeleton (Fig. 9).

Figure 7  [images/Ika/notes7a.tga]

If you keep an un-deformed copy of the mesh on a separate layer, you can toggle the visibility of that layer to make sure that your skeleton fits the body properly.

[point]Spine

Depending on the design of your character, this chain may have as few as one or as many as three segments (with two segments being the typical compromise as shown in Fig. 10).  More segments means more flexibility but it can make it more difficult to control the character.

Figure 10  [images/Ika/notes8.tga]

[point]Neck/Head

The neck and the head are typically two separate IKAs as opposed to a two segment chain (Fig. 11).  Normally, the neck doesn't move very much and most of the rotation actually occurs in the head.  If you are building a character with real eyes, you should put a single IKA in each eye (with the root of the IKA at the center of the eyeball sphere).

Figure 11  [images/Ika/notes10b.tga]

The head and the neck are limb-children of the last limb in the spine.  The neck should be left in FK mode, while the head may be left in either FK or IK mode depending on how you intend to animate it.

[point]Arms/Legs

Arms and legs can be modeled with a two-segment chain, though it can be a pain to handle joint bending in such a setup.

An easier method is to use a three-segment chain (Fig. 12).  This allows the skin to fold properly at the joint, without suffering from severe "drinking straw" pinching artifacts.

Figure 12  [images/Ika/notes2.tga]

The IKAs should be added from the top view so that the hinge allows the arms to bend forwards (Fig. 13).  Try holding out your own arm in a similar position and watch how it bends.  The arms should be limb-children of the last limb in the spine.

Figure 13  [images/Ika/notes13.tga]

Legs can be modeled using a three-segment chain similar to the arm chain.  The legs should be limb-children of the first limb in the spine (Fig. 14).

Figure 14  [images/Ika/notes14.tga]

[point]Feet

It is a good idea to use more than one bone in the feet (Fig. 15), and to make the "heel" the limb-parent of the "toe".  This allows the foot to bend as the character rolls their foot forward.  The last limb in the leg should be the limb-parent of the first bone in the foot.

Note that the two bones have been left in FK mode to make them easier to control.

Figure 15  [images/Ika/notes12.tga]

[point]Control Objects

These are the empties that are being used as IK targets, as well as bones in FK mode that will be directly manipulated.  Unless otherwise noted, empties used as controls should be limb-children of the ROOT bone.
Control empties will be easier to locate and select if you click on the NAME TogBut in the EditMenu (F9 ).
Two empties control the spine: The "Pelvis" empty is located at the base of the spine and acts as the parent to the spine chain.  This is used to set the location of the spine.  The effector of the spine is the limb-child of another empty, named "SpineTarget" (Fig. 16).

Figure 16  [images/Ika/notes4.tga]

Hand and foot empties are used as effector parents to guide the arm and leg chains (Fig. 17).

Figure 17  [images/Ika/notes16.tga]

[point]Deformation Objects

Deformation objects are additional IKAs or empties that have been added to the skeleton in order to modify the deformation envelope.  This is necessary when you find stray vertices that do not move when the rest of the limb does (Fig. 18).

Figure 18  [images/Ika/notes9.tga]

Deformation objects are limb-parented to IKAs in the primary frame and are left in FK mode (Fig. 19).

Figure 19  [images/Ika/image3.tga]

If you manipulate an IKA in IK mode, and then press ESC to cancel the operation, you'll probably notice that the IKA chain doesn't always revert to its base position.  When you are setting up the character and you are testing out the deformation, it is a good idea to save the file before moving any limbs.  When you have seen the results of the move (for better or for worse), reload the file again.  This ensures that your IKAs don't fall out of alignment and saves you having to manually reposition them in their rest post.

[point]Working with Skeletons

Before your IKAs can smoothly deform your meshes, you must collect IKAs together and build them into a skeleton.  

Press CTRL+K to calculate the skeleton.  Note that the highlighted bone (the bright pink one) will be the one that contains the skeleton information (Fig 20).

IKAs can be used in multiple skeletons at the same time.

To apply a skeleton to a mesh, make the root IKA the parent of the mesh and select the USE SKELETON option when prompted.
You may notice that the mesh doesn't update immediately when you make changes to the skeleton.  You can force an update by changing the frame.  They easiest way to do this is to press RIGHTARROW followed by LEFTARROW .

Figure 20  [images/Ika/notes17.tga]

You can adjust the deformation radius of the skeleton elements by adjusting the Deform Max Dist and Deform Weight entries in the root bone's edit menu accessed with F9 (Fig. 21).  The Max Dist is measured in grid units and refers to the diameter of the effect (rather than the radius).

Any skeleton object that has a Deform Max Dist of 0 will affect the entire mesh.  This is usually not desirable, so each item in the skeleton should have a distance specified.

Avoid setting the deformation distances too high or limbs may affect vertices that they normally shouldn't be able to reach.  It is better to set the distance too low and to compensate with extra deformation objects.

Figure 21  [images/Ika/notes11.tga]

The deformation zone surrounding each IKA or Empty in a skeleton is an elliptical shape (Fig. 22).  This radius can be non-uniformly scaled by scaling the object, or by adjusting the Deform Max Dist settings in the skeleton's EditWindow.

Figure 22  [images/Ika/notes15.tga]

Set the Max Dist for any empties in the skeleton to "2", and enable the "BOUNDS" TogBut in the empty's EditMenu.  This makes it much easier to visualize the deformation zone of the empty.  To change the size or shape of the empty's deformation, simply scale the empty and recalculate the skeleton.

It is not necessary to recalculate the skeleton after making changes to the Deform Max Dist or Deform Weight entries in a skeleton although you may not see the changes until the frame changes.

You can add bones to a skeleton by selecting all of the IKAs you wish to use (including all of the old ones), making sure that the root bone is highlighted, and pressing CTRL+K .

Before deleting a bone, or if you wish to remove one from a skeleton, you must select all of the skeleton's IKAs except for the one you wish to remove, and recalculate the skeleton.  Fig. 23 shows the spinal chain being removed.  If you simply delete a bone, the skeleton's deformation weight and distance settings will be lost and you will have to manually enter them again.

Figure 23  [images/Ika/notes18.tga]

If you change the rest position of any of the existing bones, be sure to recalculate the skeleton.  Note that when the skeleton is recalculated, any meshes that use the skeleton as a parent will reset to their rest positions.  Make sure you only recalculate the skeleton when it is in its rest position, or else you will find that the skeleton and the mesh are no longer in sync with each other.

Depending on your character's design, it may make sense to calculate more than one skeleton.  For example, the lower body and feet could use a different skeleton than the upper body.  Since Blender normally only allows a single parent per object however, you must have designed your character so that the upper and lower body are separate objects.

Fig. 24 shows the two skeletons, represented by different colors.  The ROOT bone contains the deformation information for the lower half of the body, while the spinal chain contains the information for the upper half.

The advantage to this method is that you can isolate deformations to specific parts of the body: moving the legs will not cause bending in any part of the upper body.

Figure 24  [images/Ika/notes19.tga]

[subsection]Animating

Move or rotate the entire character by manipulating the ROOT bone.

You can control most of the character's limbs by simply moving the control empties and setting LOC keys for them with IKEY >>LOC.  This is easiest if you hide all layers except for the ones containing the control empties and the IKA skeleton.

Certain controls such as the Shoulder Roll empties may require ROT keys instead of LOC keys.  The Pelvis and the ROOT will require both LOC and ROT keys.

Setting LOC and ROT keys for the Pelvis empty allows you to add bounce to the character's movements, as well as twisting the torso relative to the placement of the feet.  The Spine Target empty controls the amount of bend in the body itself.

IKAs that have been left in FK mode (such as the head and feet) may be manipulated directly.  Usually you will only need to set ROT keyframes for these limbs.
Try to avoid setting keys in more IPO curves than necessary.  For example, don't set ROT keys for effector targets, and don't set LOC keys for roll empties.  Never set keys for any IKAs that are being controlled by the empties (which should be all of them).  A good way to simplify this process is to insert LOC and/or ROT keys for all controls as appropriate on the first frame.  On all subsequent frames, insert AVAIL keys.  Because all objects will only receive keys in IPO curves that already exist, you will not have to decide which type of key to insert for each control.  If an object doesn't have any IPO curves (such as your IKAs), they will not be affected by the INSERT command.

[subsection]Conclusion

The hierarchy can become quite complex as you add more controllers and bones.  Fig. 25 shows an outline of all of the elements present in the demo file included on the CD.

Figure 25 (DTP: Please use the chart.ai !)
  [images/Ika/chart.tga]

You can take a look at the final knight model with skeleton in the file KNIGHT_IKA.BLEND on the CD-ROM (fig. 26).

Figure   [images/Ika/final.tga]


-cw- Last modified: Fri Nov 3 18:23:47 CET 2000