Now that you have learned how to model, shade, and light objects in Maya, it is time for you to learn how to make these objects move. Before continuing this exercise, download and open ball.ma, a scene containing a simple ball. We generally animate in 24 frames per second, so click the Animation Preferences button (), go to the Settings category, and make sure Time is set to Film (24 fps).
Also, for the purpose of this exercise, in Animation Preferences go to the Animation category then set Default in tangent to Clamped and Default out tangent to Stepped.
Placed directly below the viewport, the timeline is the most visible animation tool in Maya. Though relatively simple it is extremely useful. You can think of it as a summary of your animation. The dark gray bar is called the time slider. Its position represents the scene's current animation frame, information also indicated by the value on the right. To change the slider's position, simply left click anywhere on the timeline. You can also "scrub" the slider across the timeline by left clicking and dragging the mouse left and right.
Below the timeline are the range values. The two outtermost numbers (1.00, 30.00) are the start and end times of the entire animation, while the inner numbers (1.00, 15.00) designate the part of our animation that the timeline shows. Essentially, the timeline is just a window into the overall animation of the scene. To move this window, you can manipulate the gray bar inbetween the range values. Left click and drag the center of the bar to move it around, or drag one of the two small boxes to resize it. You can also just edit the values manually.
To the right of the timeline are the playback controls. Click or to play the time slider either backwards or forwards respectively. You can alter the playback options by right clicking on the timeline and choosing Playback Speed → Real-time or Play Every Frame. For now make sure that the playback speed is set to Real-time, as it is the best approximation of your animation's timing, whereas the timing of Play Every Frame is variable.
Click or to send the time slider to the beginning or the end of the playback range, and or to step the time slider back or forward one frame.
Maya uses "keyframes" for animation (we also refer to them in short as "keys"). A keyframe is basically a marker used to specify an object's position and attributes at a given point in time. To set a keyframe on the ball at the current frame, select the ball and go to Key → Set Key (or just hit s). A red tick mark should appear on the timeline near the slider, indicating that you have "keyed" the ball on the current frame. You may also notice that the attributes in the Channel Box have turned pink, an indication that the object has been keyed. The Channel Box's role in keyframing will be explained in further detail a little later.
Try setting another keyframe. Move the time slider to a different frame and use the translate tool to alter the ball's position before keying. After you set the key, scrub the time slider back and forth across the timeline. The ball should switch between its old and new positions. Note that the keyframes are probably set to "stepped" mode, which means that a keyframe will stay in effect until the next key is reached. (Alternative modes of keyframe interpolation will be discussed in the Graph Editor Exercise.)
For the sake of testing, create several more keys randomly along the timeline:
Note that the timeline will only display keyframes of the object you have selected. If you deselect the ball, the keys will disappear from the timeline until you reselect it. Conversely, if you selected more than one animated object, the keyframes of all the combined objects would be displayed on the timeline. This is something to keep in mind, as in that situation it may be difficult to tell which key belongs to which object and how many keyframes a single red tick may represent.
If you want to move quickly between the keyframes currently displayed, click or on the playback controls, or just use your keyboard's "carrot" keys (comma and period).
To change the ball's position on an existing key, shift the time slider back to the appropriate frame, move the ball to the desired location, and set the key again - thus replacing the key's previous values. Always remember that you must set the key again to save your object's new position. If you do not, moving the time slider will discard your changes. That is, unless you enable autokey.
Autokey automatically saves the changes you make to an object's keyframes. If the current frame already has a key, autokey will immediately update the key with your changes. If the current frame does not have a key, autokey will automatically create a keyframe based on your adjustments (this only works on objects with existing keys). However, be aware that with autokey it is easy to accidently create stray keys on the timeline or make changes you did not intend. Though it is recommended you do not use autokey before fully familiarizing yourself with the animation workflow, you can enable it by clicking the icon below the playback settings. It will appear as once turned on.
To delete a key, move the slider to the offending frame, right click on the timeline and select Delete. Sometimes you will want to delete or move a group of keys all at once. To accomplish this, you first need to select a portion of the timeline. Hold down shift then left click drag over the keys you want to work with. The selection should look something like this:
To move this group of keys simply left click the center arrows and drag. You can also scale the group, a quick way to speed up or slow down an animation, by moving the selection's outter arrows. Be careful when scaling keys, though; as you will end up with keys on that are on fractions of frames:
In general you never want keys on fractions of frames as they tend to get in the way and are more difficult to work with. The easiest way fix to this problem is to select the keys, call up the right click menu, and choose Snap. This will snap each key to the closest whole frame number.
As pointed out before, keying the ball will cause all of its attributes in the Channel Box to turn pink. However, it is important to note that the ball itself is not being keyed. Its attributes are. When you hit s to set a keyframe on an object, you are actually setting a key for each individual attribute (usually each attribute visible in the Channel Box).
One implication of this is that you can key a single attribute. Go ahead and delete all of the ball's keyframes. You can either do this through the timeline, or you can select all of the attributes in the Channel Box (left click Translate X and drag down to Visibility), call up the right click menu, and choose Delete Selected. The attributes should turn dark gray, signifying they no longer have keyframes on them. Right click on any attribute and choose Key Selected. Just like the Set Key operation it will create a key on the current frame, but now only for the selected attribute:
You can also make a particular attribute "Non-keyable", which prevents it from being affected by Set Key. For example, this is particularly useful for the Visibility attribute, as most of the time you do not want to worry about accidently animating it on and off. To make an attribute Non-keyable right click it and choose Make Selected Nonkeyable. Its value should turn the same color as the surrounding channel box as shown below. If the attribute had existing keyframes they will still be there, however you will not be able to edit them. If the attribute had no keys, you can edit it as a constant value but it cannot be keyed. You can make the attribute keyable again at any time by choosing Make Selected Keyable.
Now that you have learned about keyframing and how to use the timeline you will need to review the Graph Editor Exercise to learn about "splining" your keyframes.