Lesson 21: Constraints
In the last lesson, you created a skeleton, added
IK handles to some of the joints, and set keyframes on various pieces of
the skeleton. The resulting animation showed a character sitting down from
a standing position.
Another important aspect of animating characters
is the ability to create a walk cycle. To make a character walk, you want
it to plant one foot then move forward. This action needs to be repeated
by alternating feet to create the walking motion.
Just like in the last lesson, you use one IK handle
for the leg and one for the foot. Since IK handles don't have their own
dag node structure and can't be grouped, you must use constraints. Constraints
offer a groupable dag node that lets you control the foot IK handles more
easily. Using these grouped constraints and IK handles, you can easily
create a simple walk cycle.

In this lesson you animate a two-legged robot with
a gun turret. This model has a skeleton already defined as well as some
geometry that must be grouped into the skeleton hierarchy so it can animate
with the skeleton.
Using IK handles and constraints, you can make the
robot walk with planted feet. You can also use an expression to link the
constraint objects and to make sure that the hip of the robot works with
the legs. Finally, an aim constraint is used to keep the gun turret aimed
at a specific target in the scene, no matter where the robot moves.
Initial Setup
Start by retrieving a two-legged robot that is aligned
with an underlying IK skeleton.
Open an existing wire file
- From the File menu, select Open. Select the wire
file named L21_Constraints and click Open.

About the Robot Skeleton
The robot skeleton has been created with no limits
on the joints. Because you are going to use the single chain IK solution,
the limits are not needed. The following diagram shows the names of all
the robot joints that make up the skeleton hierarchy.

About the Robot Geometry
To simulate the movement of mechanical objects, such
as a knight with armor or a robot, you need to use non-deforming grouped
geometry. This keeps the surfaces rigid during animation, yet still lets
the joints move and rotate. Each set of objects grouped to a joint inherits
information from the joint. As a result, any type of surface can be used
to create these objects.
Although it may seem to have complex geometry, the
robot is really made up of simple pieces. It was created primarily with
planar and patched surfaces. Trimmed surfaces were used for details such
as the window and the front lights.
The surfaces were then grouped into several key
pieces that can rotate with the joints. The pivot point of the objects
and groups were not really a concern, because the animation will be dictated
by the joint pivots. You would need to worry about the pivot locations
only if the pieces were to be animated apart from the skeleton. The model
was created with only a few key details so it can be faster and more interactive
during playback and testing.

Grouping Geometry to a Skeleton
To make the skeleton and geometry animate as one,
you need to group the model to the bones. Think of the skeleton as the
"bones" of the hierarchy. When the objects are grouped into the
skeleton hierarchy, they will seem to be "hanging" off the skeleton
structure.
Since you are, in fact, moving and animating the
skeleton and not each individual object, you can group the objects before,
during or after animating the skeleton. Animating a skeleton without grouped
geometry may be more interactive, but it is harder to evaluate the robot's
final movement on a bare skeleton. Having the model grouped will give you
a better indication of the movement in your animation when you preview
it. Once they have been grouped, you can always hide the surfaces while
setting up constraints.
Group the left foot geometry to the skeleton
- From the Windows menu, select SBD.
Tip: Because the modeling views may be
somewhat cluttered, this window lets you pick pieces easily and accurately.
- Make the SBD window bigger and dolly in, so you can see the names of
all the skeleton nodes.
Select Pick
Object. Click on the left toe joint in the SBD window.

Note: To pick joints in the modeling window,
you need to use Pick
Joint. To pick them from within the SBD window, you can use Pick
Joint, Pick
Object or Pick
Component.
- In the Perspective window, click on the geometry of the left foot.
Tip: As in the last lesson, the surfaces
and joints are labeled from the object's perspective. As a result, the
robot's left foot is to your right.

From the Edit menu, select Group-
.
Set Null Node Grouping to Beside. Click Go.

In the SBD window, you can see that the geometry has been grouped into
the skeleton.

Group the left calf geometry to the skeleton
Select Pick
Object. Click on the left ankle (ankle_l) joint in the SBD
window. The toe joint and foot geometry are picked automatically, since
they are lower down in the hierarchy.
In the Perspective window, click on the geometry of the left calf to
add it to the selection.

Tip: Avoid picking the entire skeleton.
If you do, select Pick
Nothing, adjust your view, and redo the last two steps.
From the Edit menu, select Group. In the SBD window,
you can see that the geometry has been grouped into the skeleton.

Group the left thigh geometry to the skeleton
After grouping, the left knee joint is already picked
in the SBD window along with the joints and geometry below this node.
With Pick
Object still selected, go to the Perspective window and click on
the geometry of the left thigh.

From the Edit menu, select Group. The SBD window
shows that the geometry has been grouped into the skeleton.

Close the SBD window.
The Advanced SBD window (ASBD)
The Advanced SBD window or ASBD window lets you execute
such actions as the grouping and renaming of files from within the SBD.
You can also manage your SBD in a personalized manner, using special SBD
"pages", that let you focus on only certain dag nodes. For the
robot, the ASBD can be used to group the rest of the surfaces into the
skeleton hierarchy, using a simple click and drag.
Open the ASBD window
- From the Windows menu, select ASBD. Move and resize
this window to see more of its contents. To resize the window, hold down
the Shift and Alt keys and press the right mouse button. To move the window,
hold down the Shift and Alt keys and press the middle mouse button.
- From the ASBD window's Layouts menu, select Freeform.
This layout gives you a more personalized view of the hierarchy.
- In the ASBD, dolly and pan the view until you see the dag nodes belonging
to the left leg and its grouped surfaces.

Pick objects in the ASBD
Select Pick
Object. With the middle mouse button, click on the dag node
labeled lfoot in the ASBD.

The ASBD can be used to pick dag nodes in the same
manner as the SBD. Use the three mouse buttons to pick and unpick nodes.
Move dag nodes in the ASBD
With the cursor within the ASBD, press the Tab key. The thin
white line that surrounds the window work area turns into a thin red line.
With the left mouse button, click-drag on the lfoot node and
move it to the right of the toe_l node.

You can use the left mouse button to drag a dag
node and its children around the window. If you use the Shift key
and the left mouse button, you can move the dag node independent of its
children.
Click-drag the lCalf and lThigh nodes to the right of
the ankle_l and knee_l nodes, respectively.

Tip: When the ASBD displays a white line,
you are in Select Mode and you can use the three mouse buttons to pick
objects as usual. When the ASBD displays a red line, you're in Edit Mode
and the mouse buttons can be used to move and even group dag nodes.
Grouping in the ASBD
Another important capability of the ASBD window is
the ability to group and ungroup dag nodes using a simple click/drag approach.
Group the rFoot node with the toe_r node
- Track and, if necessary, dolly the view until you see the whole Robot
hierarchy.
- Make sure that there is a red line around the window area, then use
the middle mouse button to click-drag from the rFoot node up to
the toe_r node.

Oops! This has grouped the Foot underneath the toe
node. If you look at the left leg hierarchy you will see that the foot
should be beside the toe node.
- Use the middle mouse button to drag from the rFoot node to the
ankle_r node. Now, the toe and the foot are beside each other in
the hierarchy.

- Use the left mouse button to drag the rFoot node beside the
toe_r node.
Group the rest of the geometry into the hierarchy
- Use the middle mouse button to group the rest of the hierarchy, as
shown in the diagram that follows.

To properly group the surfaces into the skeleton
you must perform the following actions:
- Drag rCalf to knee_r
- Drag rThigh to pelvis_r
- Drag Main_bodyto tail_bone
- Drag Swivel to turret
- Drag Gun to gun_swivel If necessary,
use the left mouse button to reposition the nodes as needed. If you were
to open the basic SBD window the nodes would look as follows:

Other ASBD functions
In addition to moving and grouping nodes, the ASBD
offers many other features. In this example, you will use a few of them
to set up the robot, but be sure to check out the description of the ASBD
in Alias Overview for the full range of features.
Collapse and Expand the robot hierarchy
- With the right mouse button, click and hold the tail_bone dag
node. From the list of options, choose Collapse to collapse the
structure.

Now, you only have a single collapsed tail_bone
node.
- Dolly closer to the tail_bone node until you see a small white
square to its left. Click on the white square to expand the hierarchy.

Tip: You can use either the white box
(if the dag node is big enough in the view) or the right mouse button menu
to expand and collapse dag structures. The white box is only visible when
you are zoomed in close enough.
Rename a node
- Press the Ctrl key and double-click on the Gun node in
the hierarchy. An editor window appears. Change the name to Laser
and press Enter. You can use the Ctrl key to rename any dag
node.
Use an ASBD "page"
From the ASBD's Layouts menu, select New page.
Press the Ctrl key and double-click on the new page tab.
Rename the page to Robot. This new page is empty.

Click on the Universe page to bring it forward.
With the middle mouse button, drag the tail_bone node up to
the Robot tab. Click on the Robot tab to bring it forward.

Now you have a special dag node structure dedicated
to the robot. All dag nodes remain on the Universe page, but these secondary
pages can be used to further structure your work.
Tip: The ASBD has many features like this
that will enhance your work. Be sure to read about them in the Alias Overview
manual.

Close the ASBD window.
Save your work
From the File menu, select Save as. Change the
name of the file to Robot_01 and save the file. It's
important that you double check your SBD window to make sure that your
surfaces are all grouped as instructed. Otherwise, the surfaces won't animate
with the skeleton.
Hiding the surfaces
To add IK handles and constraints to the skeleton,
you don't need to see all of the geometry. It is a good idea to hide these
surfaces until you have some motion keyframed onto the skeleton.
Hide the surface geometry
Select Pick
Component-
.
In the option window, turn All to Off, then turn Surfaces
back On. Click Go.

- In the perspective window, click-drag a pick box around all the surfaces
of the robot and the floor surface.

- From the Object Display menu, select Invisible.
The surfaces are now hidden, revealing the skeleton.

Adding IK Handles
To add IK to the skeleton, you must apply IK handles
to both legs and feet. This way you can animate them with point constraints.
Add an IK handle to the right leg
- Select Pick
Nothing.
Select Objects
Add IK handle. Click on the pelvis joint of the right leg
to make it the root of the IK chain.
- Next, click on the ankle joint of the right leg to make it the end
effector of the IK solution.

Add an IK handle to the right foot
- With Add IK handle still selected, click on the ankle
joint of the right leg to make it the root of the IK chain.
- Next, click on the toe joint of the right foot to make it the end effector
of the IK solution.

Add an IK handle to the left leg
- With Add IK handle still selected, click on the pelvis
joint of the left leg to make it the root of the IK chain.
- Next, click on the ankle joint of the left leg to make it the end effector
of the IK solution.
Add an IK handle to the left foot
With Add IK handle still selected, click on the ankle
joint of the left leg to make it the root of the IK chain.
Next, click on the toe joint of the left foot to make it the end effector
of the IK solution.

You have now applied single chain IK chains to the
legs and feet.
Constraints
A constraint can be any node, such as a curve, object,
skeleton joint, camera, light, and so on. This object can then be applied
as a constraint to any dag node, including a joint on a skeleton. As a
result, the constrained dag node is related to the position or orientation
of the pivot point of the constraint object.
There are three types of constraints: point, orient,
and aim. Each of the constraint types are used for different reasons, but
can easily be combined in a single animation. In this lesson, you use point
constraints on various joints and IK handles.
Note: It is important to remember that
constraints can be applied to ANY dag node. In this lesson you use them
only on IK handles and joints.
Adding a Point constraint
To animate the skeleton's tailbone, you can add a
point constraint. While it is possible to simply animate the tailbone joint
itself, the use of a constraint lets you animate a more neutral node. This
neutral node can have its own hierarchical structure, or it can be removed
later.
Adding the constraint
Select Pick
Joint. With the middle mouse button, click on the tailbone joint
of the skeleton. The whole hierarchy is picked.

Select Object Edit
Constrain
Create Constraint-
.
Choose the Point constraint option and then select create selection
handle.

Click Go. It now appears as if the joint
has a selection handle on it. In fact, the handle is on a constraint dag
node that is only visible in the SBD window.
- From the Windows menu, select SBD. Beside the
skeleton hierarchy is an empty node that together with its selection handle
will act as the tailbone's point constraint.

Move the constraint node
Select Pick
Object Types
Selection
handle and click on the tailbone constraint object's selection
handle.
Select Xform
Move. In the Front window, drag the handle forward. The skeleton
body moves forward.

Note: The feet are not yet planted because
they are not constrained. You could set keyframes on them, but to make
a more useful rotating foot, constraints are needed.
From the Edit menu, select Undo.
Adding constraints to the Feet
In the last lesson, you planted the sitting man's
feet by setting keyframes on the IK handles. While this is fine for a stationary
figure, it means extra work for a walking character. To make the two IK
handles on each foot act as one piece, you should use a grouped hierarchy
of point constraints. By properly setting up the rotation pivot of the
group, you will be able to rotate the foot, if it is needed.
Add Point constraints to the left foot
Select Pick
IK handle. With the middle mouse button, click-drag over the two
IK handles belonging to the left.

Select Object Edit
Constrain
Create Constraint. Two point constraints are created with selection
handles on the foot.
Create constraint groups for each of the feet
Select Pick
Object Types
Selection
handle. In the Perspective window, click-drag over the two just-created
selection handles belonging to the left foot.
- From the Edit menu, select Group.
Select Xform
Local
Set
Pivot. Click-drag the pivot until it lies at the ankle joint of
the left foot. You may need to drag in a couple of orthographic views to
properly line up the pivot and the ankle joint.

Delete the selection handles
Select Pick
Object Types
Selection
handle. In the Perspective window, use the middle mouse button
to click- drag over the two existing selection handles. This will pick
the lower constraint nodes rather than the upper grouping node.
From the Delete menu, select Delete selection handles.
You will replace these with one handle that references the whole constraint
hierarchy.
Add selection handles to the groups
From the Windows menu, select SBD.
Select Pick
Object, and in the SBD window click on the top node of the
constraint hierarchy.

From the Edit menu, select New selection handle.
Now, the point constraints are grouped under a single node with its own
selection handle to help you pick it.
Testing the movement
To make sure that the pieces of the robot are properly
grouped to the skeleton and that the foot is working properly, you can
now test the extremities by moving the IK handles.
Bring back the surface geometry
- From the Object Display menu, select Visible.
Test the left leg
Select Pick
Object Types
Selection
handle. In the Perspective window, click on the handle belonging
to the left leg.
Select Xform
Move. Click-drag in the Front window to test the motion on
the leg.

If something looks wrong with the robot's geometry
and it is not following the skeleton, then it was not grouped properly.
Go back to the SBD view and see if the surfaces are grouped in their proper
places.
- From the Edit menu, select Undo.
Select Xform
Rotate. Click-drag with the middle mouse button to test the
rotation capabilities on the leg.

- From the Edit menu, select Undo.
Hide the surface geometry
Select Pick
Component. In the front window, use the middle mouse button
to click-drag a pick box around all the surfaces of the robot and the floor
surface.
From the Object Display menu, select Invisible
to hide the Robot surfaces. Now add constraints to the rest of the skeleton.
Repeat for the other leg
Repeat the steps used above to place a constraint group on the right
foot. Don't forget to set the pivot at the right ankle joint.
Naming the pieces
In order to work with the IK handles, it is a good
idea to assign them useful names using the information window. If you are
going to apply expressions to the nodes, it is also a good idea to use
short names that can be easily remembered to make entering expressions
easier.
Rename the left constraint group
Select Pick
Object Types
Selection
handle. In the Perspective window, click on the handle belonging
to the left foot group.

- From the Windows menu, select Information
Information window... Change the name of the handle to cons_l
to make it easier to type into expressions.

Rename the right constraint group
- Click on the right selection handle with the middle mouse button and
rename the group's node as cons_r.

- Close the information window.
Adding an Expression
A useful animation technique is to use an expression
to animate the position of the tailbone constraint. One expression places
the center constraint just in front of the half way point between the two
feet, while another uses half of the height of a raised foot to animate
the body bobbing up and down.
By handling the motion of the tailbone constraint,
these expressions let you focus on keyframing the feet. Although the motion
of a human hip is more complex and is not always found at the half way
point of the feet, this robot is a little more simple.
Adding Expressions to the tailbone constraint
With Pick
Object Types
Selection
handle still selected, use the middle mouse button and click on
the tailbone constraint object's selection handle.

- From the Animation menu, select Action window....
In the Action window, click on the timeview icon.
- Click on the expand animation button next to constraint.

- Double-click next to the X Tra channel and at the prompt, enter
the following:
( ( (cons_l:TX + cons_r:TX ) / 2 ) - 0.7995 )

This expression finds the half way point between
the positions of the right and left ankles. The -0.7995 part of the equation
positions the tailbone constraint slightly ahead of the half way point
of the ankles. The value of 0.7995 was obtained by checking the
difference between the X- axis position of the tailbone constraint versus
the ankle constraints before adding the expression.
Add an expression to the Z Translate channel
- Double-click next to the Z Tra channel and at the prompt, enter
the following:
( ( (cons_l:TZ + cons_r:TZ ) / 2 ) + 5.0)

This part of the expression adds together the Z
translate values of the feet, then adds 5 to keep it above the ankles by
this amount. As the feet are each raised individually, the tailbone will
bob up and down in response.
- Close the Action window.
Set the performance options and test the motion
From the Preferences menu, select Performance options....
Under Expression Updates, set During Xform to ON.
Close this window.
With Pick
Object Types
Selection
handle selected, use the middle mouse button to click on the left
leg's selection handle.
Select Xform
Move, and in the Front window, click-drag to move the IK
handle.

As the IK handle moves, the tailbone constraint
also moves. You can now focus on setting keyframes for the feet knowing
that the tailbone will follow.
From the Edit menu, select Undo.
Animating the Robot
To animate the robot walking, keyframes must be set
on the feet. You can start by animating the up and down motion of the feet.
Then, using a different technique, you can animate the feet moving forward.
A simple walk cycle is created and you can complete the cycle using the
Action window.
Set the Param Control window
Select Pick
Object Types
Selection
handle. With the middle mouse button, click-drag over both constraint
groups to pick them.
- From the Animation menu, select Param control
to open the parameter control window. For both constraints, turn off all
the channels except for the Z Translate channel.

Set keyframes for frame 0
- In the Time Slider, change the range to Min/Max
and change the current frame to 0.
- From the Animation menu, select Set Keyframe-
.
Set Parameters to Local, and the In and Out Tangent
types to Linear. Make sure that Frame is set to Current.
Click Go. 
Keyframes are set for the Z translation of the two
ankles.
Set Keyframes for the right foot
With Pick
Object Types
Selection
handle still picked, use the middle mouse button and click on the
right foot's constraint group to pick it.

In the Time slider, change the current frame to 10.
From the Animation menu, select Set Keyframe.
In the Time slider, change the current frame to 20.
From the Animation menu, select Set Keyframe.
In the Time slider, change the current frame to 5.
Select Xform
Move. Enter r 0 0 1.5 to move the handle up by 1.5 units.
From the Animation menu, select Set Keyframe.
Copy the Keyframes to the left foot
From the Edit menu, select Copy Keyframes. Enter
0 10 to copy the keyframes from within this range.
Select Pick
Object Types
Selection
handle and use the middle mouse button to click on the left foot's
selection handle to pick it.

From the Edit menu, select Paste Keyframes. At
the prompt, enter 10. This pastes the frames from 10 on.
Playback the animation of the constraints
Press the Playback button on the Time slider. This shows the
ankle constraints moving up and down, one after another. When
you are finished, press the Stop button on the Time slider, then
click the Go to First frame button.
Cycling the motion
To make the robot's feet go up and down a few more
times, you could copy and paste keyframes as you did with the bouncing
ball in Lesson 16. But, for this lesson, you'll apply a cycle to the two
ankles to make the motion continuous.
Open the Action window
Select Pick
Object Types
Selection
handle. With the middle mouse button, click-drag over both of the
feet to pick these constraints.
- From the Animation menu, select Action window.
Press the Graph Editor icon to see the animation channels.
- From the Action window's Views menu, select Look at
to get a better look at the animation curves. Dolly out a little to see
the frames surrounding the animation curves.

Cycle the motion
- From the Action Window's Pick menu, select Curves.
Click on the two action curves to pick them.
- From the Action Window's DispTools menu, select Tgl infinity.
A dotted line appears to the left and right of the two curves.
- From the Action Window's ActionTools menu, select Cycle
After. Now the up and down motion of the Robot will continue forward
to infinity.

Close the Action window.
Playback the animation of the constraints
In the Time slider, change the range to Start/End
and change the range values to 0 and 120.
Press the Playback button on the Time slider.
This shows the ankle constraints moving up and down, one after another,
until the End frame is reached. When you are finished,
click the Stop button on the Time slider, then
click the Go to First frame button.
More keyframes
Next, you keyframe the forward motion of the robot.
This time, you'll use the Expression controls window to apply
the keyframes using a different technique.
Of course, a more intuitive way to set keyframes
is to move the feet in the modeling windows and visualize the results.
But, if you like to work in a parameter window, the Expression controls
window is a good option. This window is also useful because it
bypasses the parameter control window.
Open the Expression Controls Window
- From the Windows menu, select Expression Controls....
- In this window's title bar, enter TX in the channel filter field.

This removes the Z Translate channels and limits
you to the cons_l and cons_r X channels.

Set Keyframes on the left leg
- In the Time slider, go to frame 0.
- Click on the cons_l TX channel name and enter -5 in its
field.
- Press the shift key and click on the cons_r TX channel name
and type 0 in its field.

- Click on the Key button at the top of the control window to
set a keyframe on these channels.
- In the Time slider, go to frame 10.
- Type -10 in the cons_r TX channel and click on the Key
button to set a keyframe for both channels.

- In the Time slider, go to frame 20.
- Type -15 in the cons_l TX channel and click on the Key
button to set a keyframe for both channels.

Cycling the motion with an offset
To cycle the forward motion of the robot, you can
use a method similar to the up and down motion. This time, you should apply
a cycle with offset so that the values of the motion are added to
the last part of the curve.
Open the Action window
- With the ankle handles picked, go to the Animation menu and
select Action Window.
- From the Action window's Pick menu, select Nothing.
Then, from the Views menu, select Look at to get a
better look at the animation curves. Dolly out a little to see the area
surrounding the animation curves.
Cycle the motion
- From the Action Window's Pick menu, select Curves.
Click on the two X Translate action curves to pick them.
- From the Action Window's ActionTools menu, select Cycle
After Now the forward motion of the Robot will cycle to infinity.

Playback the animation
In the Time slider, press Play. Oops!
This cycle shows the feet forward, then going back to 0 when the cycle
is complete. In the case of X, the motion needs a cycling that ADDS to
the motion instead of repeating it.
Cycle the motion with an offset
Stop the playback then go to the Action Window. Make sure that the
two X Translate action curves are picked.
From the Action Window's ActionTools menu, select Cycle
After with offset. Now, the forward motion of the Robot cycles
forward to infinity.

Close the Action Window.
Playback the animation
In the Time slider, press the Playback button.
This shows the feet moving forward without jumping back to 0. When
you are finished, press the Stop button on the Time slider, then
click the Go to First frame button.
Adding an Aim constraint
The third constraint type is an aim constraint that
makes a skeleton joint point at the constraint object. To learn how this
constraint type works, you can add an aim constraint to the gun barrel
so that it points at an object in the scene.
Place a Sphere into the scene
Select Objects
Primitives
Sphere.
Enter -32, 15, 5 to place the sphere to the right of the robot's
path.
- Change the view so that you can see the sphere and the robot walking
up to it.

Set the Local axis of the gun joint
With Nothing
picked, select Pick
Joint. Click on the gun barrel's swivel joint (the rear joint,
not the front) to pick it.
Select Xform
Local
Set
local axes. You will see that the X axis is pointing out, but no
axis is pointing up.

- Enter: a 0, 0, 180 to rotate the local axes in absolute
mode, so the X axis is pointing along the gun barrel and the Z axis is
up. The orientation of these axes is crucial to properly setting up an
aim constraint, since the Aim and Up axes must be clearly defined.

Apply the aim constraint to the gun joint
Select Object Edit
Constrain
Constrain to
-
. In the constraint
option window, change the Constraint type to Aim. Make sure
that the Aim Axis is set to X and the Up axis is set
to Z.

Click Go. At the prompt, click the sphere, as the dag node the
gun barrel joint will aim at. The constraint is set.

Playback the animation
Press the Playback button on the Time slider. The gun barrel
joint now points at the ball as the robot walks by. If
you now wanted to move or animate the ball around the scene, the gun barrel
will follow it.
From the Object Display menu select Visible to bring back the
surface geometry. Replay the animation.

Press the Stop button on the Time slider then click on the
Go to First frame button.
Save your work
From the File menu, select Save as. In the File
lister, enter Robot_final.
Rendering and viewing the animation
Now that the animation is working, you can render
it at a low resolution to see the results. Use the same method for creating
test rendered animations as you learned in Lesson 13: Rendering.
Run IK
Sometimes after animating a skeleton, you may want
to see the animation of all these elements translated into rotation information
on the joints. If you do, then you must apply Run IK. By
translating the information into rotational information, you can apply
more subtle edits to the various animation channels for secondary motion.
Pick the skeleton and Run IK
Select Pick
Joint. With the middle mouse button, click on the robot's
tailbone joint to pick the whole skeleton.
Note: You did not pick the selection
handle because it would have picked the constraint node instead of the
skeleton. You must have the skeleton picked to Run IK.
- From the Animation menu, select Run IK -
.
In this window, change the Frame Range to
Option Window and the Start Frame to 0 and the End
frame to 120.

Next, click on the With Single Chain and Spline
option. This lets you Run IK on the Single Chain IK chains.
Next, choose Disable Single Chain and Spline. This means that the
IK handles will be turned off after Run IK is applied and the rotation
on the joints will take over. If you want to reactivate the IK chains,
then you can turn them back on in the Information window...
Click Go. The system computes and then records
the animations onto the joints.
- Pick one of the robot's knee joints, then go to the Animation
menu and select Action Window.

The Y Rotation channel now has keyframes set. Close
this window.
Select Pick
IK handle. Use the middle mouse button to click-drag over
one of the IK handles to pick it.
- From the Windows menu, select Information
Information window.... In this window, open the IK Handle
Info section. You will find the IK handle has been turned off. Now the
rotations on the joints will govern any playback and rendering.

Baking your animation
In some cases, you may find that you want to get
the animation of the various expressions and constraints not onto the joints
as Run IK does, but rather, back onto the IK handles themselves.
To do this you can use a special plug-in called bake.
This plug-in can be loaded using the methods outlined in the plug-in manager
section of Alias Overview. After it is loaded, it is placed on the
Animation menu.
How to use the bake plug-in
- Open the Robot_final wire file.
- From the Animation menu, select Bake -
.
In the option window, pick both Constraints and Expressions.
Make sure that Objects is set to All. Change
the Start Frame to 0 and the End Frame to 120.

Click Go and the animation of the constraints
and expressions is translated onto the appropriate joints and nodes.
Playback the animation
- If desired, delete any constraints from the scene.
- Playback the animation in its "baked" form.
Conclusion
When animating IK skeletons, you can combine IK handles,
constraints and expressions for various types of motion. Remember that
these tools offer various techniques that in turn, offer different solutions.
Constraints will solve certain animation problems, while IK handles alone
will solve others. You should try to animate a character using these tools
in combination for best effect.
You should also be sure to check all the plug-ins
available to you. These include many task-specific tools that will streamline
your workflow and help you create and refine animations quickly and easily.
aliasdocs@aw.sgi.com
Copyright © 1997, Alias|Wavefront, a Silicon Graphics Company.
All rights reserved.