Constraining IK Motion
Intro to Inverse Kinematics
383
Constraining IK Motion
You can limit the way IK bones move. You
can allow or prevent a bone from rotating, for
example, to control the way a character can
bend its arms and legs. You can also allow
or prevent movement along a bone’s x-axis
(x-translation) and/or y-axis (y-translation).
e axes in this case refer not to the x- and
y-axes of the Stage, but to the axes of the
bone instance (see the sidebar “Translating
the Direction of Translation”). Enabling trans-
lation for the parent bone in an armature
allows the entire armature to move around
on the Stage. Enabling translation for a child
bone allows that bone to move closer to its
parent or farther away. Moving a child bone
along its x- and/or y-axis within an armature
in an IK shape can make the shape expand
and contract. Making such movements in an
armature connecting IK nodes can help you
to create mechanisms with moving parts.
e methods for enabling and constraining
rotation and translation with IK nodes and
IK shapes is similar.  e tasks below work with
IK nodes. Try experimenting with enabling
and constraining the motion of bones within
a shape once you’ve completed the tasks
with nodes.
Translating the
Direction of Translation
Although x- and y-translation deals with
movement along the horizontal and
vertical axes, the axes in question are not
the axes of the Stage.  is can be confus-
ing at  rst. Each bone instance has its
own x-axis and y-axis; the orientation of
the axes depends on a variety of factors,
including the bones original orienta-
tion to the Stage, the bone’s original
orientation to its parent bone, whether
the bone is in an IK shape or is connect-
ing IK nodes, and whether or not the
bone has been rotated from its original
position.  e easiest way to tell where
the axes of a bone are, and what direc-
tions they cover, is to select the bone and
look at the range-of-motion icon at its
head (see the sidebar “ e Mysterious
Range-of-Motion Icons”). When transla-
tion is enabled for the selected bone,
the icon includes double-headed arrows
for unconstrained x- and y-translation,
I-beams for constrained translation.  e
arrows (or I-beams) indicate the direc-
tions in which the head point of the bone
can move.
Constraining IK Motion
384
Figure 13.24 Selecting a bone in an armature reveals
its properties in the Property inspector. By default,
joint rotation is enabled. You can manipulate the
selected bone by dragging it with the selection tool;
you can rotate the bone 360 degrees around the
head point. The rest of the armature follows along.
By default, joint translation is disabled. The head of
the bone cannot move from its current x-/y-coordinate.
Figure 13.25 When you select the Constrain check
box in the Joint: Rotation section of the Property
inspector, Flash creates Min and Max values of
–45 and 45 degrees for the selected bone (top).
The range-of-motion icon depicts the motion
available to the bone (bottom).
To constrain rotation at a bones head:
1. Create a simple IK armature that uses two
bones to connect three symbol instances
in a horizontal chain.
is task uses three instances of a symbol
containing a rectangle.
2. Using the selection tool, select the
armature containing the bone you want
to constrain.
3. Click the parent bone, the  rst bone in the
chain, and access the Property inspector.
e selected bone highlights, and its
properties appear in the inspector
(Figure 13.24).
4. With the parent bone selected, in the
Joint: Rotation section of the Property
inspector, select the Enable check box
(it is selected by default).
When joint rotation is enabled, the
selected bone can rotate through 360
degrees around its head. To restrict
that movement, you must constrain
the rotation.
5. Select the Constrain check box.
Flash assigns default constrain values:
Minimum –45 degrees, Maximum 45
degrees (Figure 13.25).
Selected bone
Chapter 13

Get Adobe Flash CS4 Professional for Windows and Macintosh: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.