|
Features

Giving
Life to Ratchet & Clank:
Enabling Complex Character Animations by Streamlining Processes
Dissecting
the IK Setup Tool
MEL
is a quirky and often inconsistent language. A good portion of the
time we spent developing our IK Setup Tool was used to track down
the proper commands for the tasks we needed to execute. Still, we
managed to uncover the MEL commands we needed to actuate the core
tasks of each of our nine tool buttons.
The
first button's purpose was to place IK handles on a character's
legs. It read the names of the bones from the top text fields by
using the textFieldGrp command in its query (-q) mode. These string
variables were then passed to the ikHandle command, which in turn
created the IK handles.
The
second button placed NURBS cones on a character's hip, ankle, and
toe joints. These cones, created using MEL's cone command, were
the primary constraint objects an animator would use to manipulate
the legs. The xform command was used to query (-q) the positions
of the leg bones and store them as variables. The move command then
read these variables and moved the cones into place. Finally, MEL's
pointConstraint locked the hip cones to the character's hips.
Pressing
the third button called CreateLocator to place a pair of locators
in the scene. Next, the group command grouped the locators to themselves.
Then xform (-q) queried the positions of the character's knees,
and move translated the two new parent objects to the knee joints
and the locators to positions in front of the knees.
Button
number four configured the cones, locators, IK handles, parent groups,
and constraints into a standardized hierarchy via the parent command.
Again, the new groups were translated into place using move. New
constraint relationships were created between the knee locators
and main leg IK handles, and the new constraint hierarchy and the
skeleton. These were implemented using the poleVectorConstraint
and scaleConstraint commands, respectively.
Button
five added several expressions to the scene, saving us data-entry
drudgery. We added expression code for specifying both constraint
and skeletal behavior using the expression command, allowing us
to automate both the creation and the specifications of our setup
expressions.
Number
six altered the rotate order of the heel and toe NURBS cones from
XYZ to YXZ using setAttr. We had previously determined that this
rotate order produced the most reliable rotations in our quaint
Z-up environment.
Buttons
seven through nine performed some final housekeeping tasks. Button
seven grouped custom rotation guides to a character's spine using
the polyCube and parent commands. Button eight used setAttr to ensure
Maya's segment scale compensate was switched off for all of a character's
joints. Finally, button nine keyed a reference frame at -10 on the
character's skeleton and constraint hierarchies using setKeyframe.
Listing 1 shows some of the MEL procedures we found most
useful.
Automating
this process with MEL both saved us time and eliminated the steps
most prone to human error. Furthermore, by enabling any artist,
regardless of their setup experience, to fit a prototype and/or
character with a functioning IK system quickly, we alleviated bottlenecks.
This conservation of both time and human resources saved energy
that could then be devoted to artwork.
|
|
Listing
1. Some helpful MEL procedures.
//
A method for querying a bone's position in world space:
xform
-query -worldSpace -translation my_joint_name;
// A method for querying the contents of a text field:
textFieldGrp
-query -text my_text_field_name;
// A method for setting a keyframe at frame -10 on a hierarchy:
setKeyframe
-time -10 -hierarchy below my_hierarchy_name;
// Basic transformation methods: translation, rotation, and
scaling:
// Moves an object to (0,0,5):
move
-absolute 0 0 5 my_object_name;
// Rotates
an object by 90 degrees on Z,
// relative to its current Rotation:
rotate
-relative 0 0 90 my_object_name;
// Scales an object to 3 times its current size:
scale
-relative 3 3 3 my_object_name;
// (Note: All flags are listed in their long forms.)
|
 |
 |
 |
Low-Tech
Animation Solutions
The
shortcuts and prototypes I've described so far shared a common purpose:
to help us create better animation more efficiently. Both of these
methods accomplished this by either by telegraphing problems or
by saving time. Often, however, we would spurn a high-tech solution
due to its specificity, inefficiency, and/or complexity. And still
at other times, we embraced traditional CG taboos.
We
consistently and repeatedly translated and scaled our characters'
bones. True, most of us learned on our grandmothers' knees never
to do that to a CG character. "Use your constraints,"
she would say. "Rotate your bones if you must. But avoid scaling
them, and don't ever, ever let me catch you in a translation!"
We all love our grandmothers, but we found that the tenets of traditional
animation called for - nay, demanded - that we defy her.
The
reason behind our disobedience was squash and stretch. We found
that by scaling our joints, and especially by translating them,
we could instill our animations with extra gravity and snap. Major
translations often lasted only a couple of frames and, borrowing
an idea from Disney, were "more felt than seen."
Since
we had no IK setups to speak of on the spines and arms of our characters,
translating the bones in these body parts was quite simple. If needed,
we could key the leg IK solvers "off" in order to manipulate
these joints. Translation and scaling were effective across the
board and worked wonders on anything from walks to attacks to facial
animation (Figure 7).
Requiring
no additional setup, these low-tech solutions saved us time. Within
limits, this method of animation provided animators with a direct,
tactile, and expedient method of sculpting their characters' poses.
Although unglamorous, this technique was as effective as any in
terms of preserving our resources and improving our animations.
|