Apple Pro Training Series: Motion 5: Animating with Keyframes
Please note that the lesson files that accompany this book are not available with this sample chapter. They are made available upon the purchase of the book.
Lesson Files |
Motion5_Book_Files > Lessons > Lesson_04 |
Media |
Motion5_Book_Files > Media > Stage Motion5_Book_Files > Media > Rockumentary |
Time |
This lesson takes approximately 60 minutes to complete. |
Goals |
Record keyframes Set keyframes manually Use the Keyframe Editor Change keyframe interpolation and adjust keyframe curves Add, move, and change the values of keyframes on a curve Set keyframes for multiple layers simultaneously Change keyframe timing in the Timeline Choose keyframe curves for editing in the Keyframe Editor |
In the previous lesson, behaviors allowed you to create animation procedurally—you applied a behavior that contained a set of instructions for making the layer animate. Setting keyframes is a way to articulate an animation—that is, manually identify exactly what, when, and how you want to animate.
The term keyframes, or key frames, originates from traditional hand-animation techniques in which a senior artist would draw “key” poses of a character and turn over those images to a junior artist, who would draw the in-between frames to create smooth character animation from one keyframe to the next.
In Motion, keyframes work much the same way: You are the senior artist, creating your composition and identifying the frames you want to establish as keyframes; and the computer acts as the junior artist, creating in-between frames of animation through a process called interpolation.
Whether you should choose to animate using keyframes or behaviors is not always a clear-cut decision; but as a rule of thumb, if you want repeated, continuous motion—such as a graphic drifting across the screen, a pendulum swinging, or a neon sign blinking—use behaviors. If you want animation that starts, stops, and changes direction at specific points in time, use keyframes.
In this lesson, you’ll open the stage project and animate the curtains using keyframes to compare that method to animating with behaviors. You’ll also experiment with interpolation types and adjusting keyframe Bezier handles. We’ll then set and adjust keyframes in the Rockumentary project to animate multiple layers to form a composition.
Recording Keyframes
The easiest way to set keyframes is to turn on recording. When recording is turned on, every change you make to any keyframeable parameter will be recorded as a keyframe at the playhead location, locking in the new value at that point in time. In this exercise, you will use recording to set a keyframe for the rotation value of the first cog, which will cause the curtains to part.
- Open Motion5_Book_Files > Lessons > Lesson_04 > Keyframes Start, and save the project to the Student_Saves folder.
This is the stage project you worked with in the previous lesson. The position of the curtains is linked to the Cog1 layer with the Link behavior, as is the rotation of all the other cog layers. But the Cog1 layer is not currently animated. You can test the animation by rotating the Cog1 layer.
- Open the Stage and Gears groups, select the Cog1 layer, and in the Canvas, drag the rotation handle.
Rotating the Cog1 layer clockwise turns the other cogs and opens the curtains. In the previous lesson, you animated the rotation of this layer using a Rate behavior and stopped the rotation with a Stop behavior. The result was a rather abrupt ending. Here, you’ll animate the rotation by recording keyframes.
- Press Command-Z to undo the rotation, and at the bottom of the Canvas, click the Record button. The button turns red to let you know that recording is enabled.
- Press F1 to open the Properties Inspector.
The value fields for all parameters are now red, another warning sign that recording is enabled. If you change any red parameter, it won’t change for the whole project; it will change only at the playhead position. Let’s see how this works.
- In the timing display in the toolbar, type 5. (5 period) and then press Return (or Enter) to move the playhead to the frame at five seconds. This is the frame where you want the curtains to stop opening.
- In the Properties Inspector, drag left in the Rotation value field to about −300 degrees as you watch the curtains open in the Canvas.
A yellow diamond appears to the right of the value field to indicate that a keyframe for this parameter has been set at the current playhead location.
- Play the project. The curtains animate open until 5:00, and then stop.
- Stop playback on any frame other than 5:00 or 0:00. The yellow diamond for Rotation is now gray. A gray diamond indicates that at least one keyframe for this parameter exists, but not at the current playhead location.
- Move the playhead to the start of the project. The diamond turns yellow again, indicating that a keyframe exists at the playhead. But wait a minute. You only set a keyframe at 5:00, not at 0:00. Why is there a keyframe here, too?
A single keyframe will not create animation; it locks the value of the keyframed parameter at a point in time, but the parameter will have that same value at all other points in time. To animate with keyframes, you need to have at least two keyframes with different values.
When you use recording to set keyframes, Motion assumes that you want the value to change over time, so it automatically sets a keyframe with the original value at the beginning of the layer you are animating. Remember that recording will always perform this action, although sometimes you may not want a keyframe at the beginning of the layer.
By default, when recording is enabled, any other changes you make to the Cog1 layer, such as adjusting its position or scale, will set keyframes for that parameter as well. Sometimes, you’ll want to make an overall adjustment to a parameter without setting a keyframe, yet you’d still like to add keyframes to a parameter you’ve already animated.
- Double-click the Record button. The Recording Options dialog opens. One of the options in this dialog is to “Record keyframes on animated parameters only.”
- Select “Record keyframes on animated parameters only” and click OK. If necessary, click the Record button, or press A, to turn on recording
Now only the Rotation value field is red, indicating that keyframes will be applied only to changes to this parameter. Changes to other parameters will change the value for all points in time.
- Change the Position Y value for the Cog1 layer, and play the project. The Cog1 layer and all its clones are in new locations, but their positions don’t change over time as they would with keyframes.
- Press Command-Z to undo the position change. Double-click the Record button, deselect the “Record keyframes on animated parameters only” checkbox, and click OK. You are returned to the default setting. If necessary, click the Record button to turn off recording.
You’ve now animated the Cog1 layer and the curtains linked to it using keyframes. But the resulting animation is very similar to the animation in the last lesson: The curtain movement still comes to an abrupt stop at 5:00. You can make the curtains slow to a smoother stop by using keyframe interpolation.