Animating the Flower Stalk with Inverse Kinematics
ACA Objective 4.4
Inverse kinematics allows you to animate objects in Animate CC using a series of bones chained into linear or branched armatures in parent-child relationships. This means that when one bone moves during an animation, that connected bones will also move in relation to it. Inverse kinematics is a unique way of animating content to create natural motion.
To animate using inverse kinematics, specify the start and end positions of bones on the timeline. These positions are known as “poses” in Animate CC. The armature will be automatically adjusted to tween positions of the bones in the armature between poses (Figure 4.25).
Figure 4.25 Animating an armature using inverse
You can apply inverse kinematics within Animate CC in one of two ways: by drawing bones within a single shape or through the construction of an armature composed of multiple movie clip symbol instances. In this project, you’ll create a shape-based armature from the flower stalk you just created.
Animating the flower stalk using an armature layer
Your next step is to animate the stalk growing up and out of the flowerpot. To do this, you’ll take advantage of the armature you’ve already created. You don’t need to specify any sort of tween when working with armatures; Animate CC will handle all of this automatically once different poses are defined.
First, you’ll need to extend your frame span to the 6-second marker. To do so, move the playhead to frame 144, select the frames across all layers, and choose Insert > Timeline > Frame.
These frames will provide enough time to nicely animate the growth of your stalk and will allow for some automated “springiness” once the animation has concluded. Bring the playhead back to frame 1 when finished.
Select the Bone tool () from the Tools panel. You’ll use this tool to define the bones within your armature.
To define a bone, drag a short way from the bottom of the stalk to the first branching stalk (Figure 4.26). You will draw subsequent bones across the shape by pressing the mouse button over the end point of the previous bone and dragging out a new segment.
Figure 4.26 Defining the initial bone
Draw about three or four bone segments along the central stalk to the top. Try to have each joint (the juncture between each bone) aligned with one of the secondary stalk elements.
We will now branch our armature out across the secondary stalk segments. For each joint closest to a secondary segment, pull out more bones to define those segments as part of the armature. Each secondary stalk segment should have about three bones apiece (Figure 4.27). The reason for creating many bones is to increase flexibility and refine the range of motion.
Figure 4.27 The completed armature extends across all stalk segments.
Notice how the stalk layer is now empty? A new layer named Armature_1 now exists above it with the frames colored light green, and the icon is a small figure. These changes indicate that this is a new armature layer (Figure 4.28).
Figure 4.28 The light green layer color indicates an armature layer.
Because you’re using an armature, all you need to do to modify your pose is to drag with the Selection tool. Try it out! Notice how everything naturally moves in relation to any portion of the stalk you click and drag? This is the power of inverse kinematics.
Once an armature is assembled, it has a default pose. When you modify a property on any particular frame, it’s called a pose. Poses can be copied for easy modification and reuse. You want your ending frame to contain a pose with the stalk fully extended.
Let’s go ahead and delete the existing stalk layer—it is no longer needed. Rename the armature layer to stalk, for clarity.
Select frame 48 (the 2-second marker) on the armature layer and right-click. Choose Insert Pose from the menu to duplicate the pose from frame 1. The flower stalk will remain completely opened within this second pose.
Return to frame 1 and use the Selection tool to modify the initial pose so that the secondary stalk segments are much closer to the main stalk. They will spread out as the main stalk becomes taller.
Now, pull the main stalk slightly to the side in order to introduce further differentiation between poses (Figure 4.29).
Figure 4.29 The pose for the emerging stalk
Use the Selection tool to select the entire plant.
Use the arrow keys to reposition the entire stalk down into the flower pot a bit. It’s fine to have most of it sticking out, but we want to give the illusion of growth and this will help (Figure 4.30).
Figure 4.30 The completed pose for the initial stalk
If you preview the animation between frames 1 and 48, you’ll see that Animate CC performs a special armature tween between these two poses. The stalk begins with its branches very close to the main stalk and is seated low in the pot. The secondary stalk branches spread outward as the primary stalk appears to grow taller.
This is nice…but working with inverse kinematics allows us to add in a bit of dynamic animation as well—by applying values of Strength and Damping to each bone segment’s Spring property. We have allowed a few extra seconds in the time-line beyond the 2-second mark for this very purpose.
Adding Spring to the armature animation
The stalk animation runs for only two seconds at the moment, but by adjusting the Spring properties for various bones, we are able to dynamically generate additional, subtle movements based on inverse kinematics.
Zoom in about 200 percent so that it is easy to manipulate the armature.
We’ll focus on one of the secondary stalk segments for now.
Each secondary segment should have three bones defined across its length. Using the Selection tool, click the bone that is farthest from the main stalk. The bone is now selected and appears highlighted.
In the Properties panel, in the Spring section set Strength to 90 and Damping to 2 (Figure 4.31).
Figure 4.31 Stalk bones farthest from the main stalk should be very springy.
Do a similar thing with the middle bone for this secondary stalk. You can even make it slightly less springy: set Strength to 80 and Damping to 3.
Strength defines the intensity of the springiness of a certain bone, and damping determines the decay of the motion.
Now select the bone within the chosen segment that is closest to the primary stalk. Notice the Spring settings are all at the default of 0.
For this bone, since it is much closer to the stalk body, the springiness should be less pronounced than the bones that are farther away. Set Strength to around 60 and set Damping at 10 (Figure 4.32).
Figure 4.32 The less-springy, attached stalk portion
Now, switch your focus to the two bones that make up the other secondary stalk. Set the Spring properties values similar to what you’ve done for the first secondary stalk segment.
Preview the animation once again. The movement between frames 1 and 48 is nearly identical to what we had achieved before. With the addition of Spring values for Strength and Damping, you’ll note that Animate CC also produces some subtle movements in the branches even after the initial animation has completed. This provides a more natural physical movement to the entire armature.