Chapter 8

Introduction to Animation

The best way to learn how to animate is to jump right in and start animating. You will begin this chapter by picking up the Mobile exercise from Chapter 2, “Your First 3ds Max Project,” and adding animation to the shapes of the mobile. You’ll take a good look at 3ds Max’s animation tools so you can start editing animation and developing your timing skills.

Topics in this chapter include the following:

  • The mobile redux: setting up hierarchies
  • Using dummy objects
  • The bouncing ball
  • Using the Track View–Curve Editor
  • Track View
  • Anticipation and momentum in knife throwing

The Mobile Redux: Setting Up Hierarchies

Do you remember way back when you were reading Chapter 2? In the exercise in that chapter, you had a chance to set up the mobile so you could become more familiar with the 3ds Max UI. Now we’ll revisit the mobile and set it up to animate, and you’ll learn how to create hierarchies as we go.

The first section of this chapter will take you through setting up these mobile objects for animation in hierarchies so that when one bar rotates, the shapes and any bars beneath it also rotate.

In the following section, we will tackle hierarchies and setting up the mobile objects to animate properly.

Parent and Child Objects

Before we continue with the next step in the Mobile exercise, let’s take a look at hierarchies in action. Here is a quick introduction to how hierarchies work.

In the following steps, we will create a hierarchy of a few boxes to see how the relationship works when parents move, taking their children with them, and how children can move independently under their parents.

Figure 8-1: Create and line up three boxes.

f0801.tif

1. Start a new scene. In the Create panel under Standard Primitives, click Box to create a new box. Click and drag in the Front viewport and draw out a box. When you are happy with the size of the rectangle, release the mouse button and then drag the mouse further to pull out the third dimension of the box to give it depth. Click again when you are happy with the 3D box, and 3ds Max will create it. Your cursor will still be active in the Create Box tool. Click and drag to create two more boxes of approximately the same size to the right of the first box, as shown in Figure 8-1.

2. You need to set up a hierarchy so that the box on the right is a child of the box in the middle, which in turn is a child of the box on the left, like a row of ducks. In the Main toolbar across the top of the UI, click the Select and Link tool (i0801.tif). The Select and Link tool works upward, meaning you select the bottom of the hierarchy and work your way up, as you’ll see next.

Figure 8-2: Notice the cursor cues.

f0802.tif

3. In either the Front or Perspective viewport, click the box on the right and then drag the mouse over to the box in the middle. A dashed line will appear and the cursor will change to the “Select and Link” icon while you do this, as shown in Figure 8-2. When you release the mouse button, the parent box will flash a white outline. This indicates that the link worked. The box on the right is now a child of the box in the middle.

Figure 8-3: The box follows as you drag it.

f0803.tif

4. Click the Move tool (i0802.tif) and select the middle box. Move it around in the viewport. The box on the right (the child) will now follow, as shown in Figure 8-3. Click the child box on the right, and move it. Notice the child can move independently of its parent (the box in the middle).

5. Click the Select and Link tool (i0801.tif) again. This time click on the box in the middle and drag it to the box on the left. Select and move the box on the left, and all the boxes will follow.

Now let’s set a few keyframes on these boxes to get our juices flowing.

Setting Keyframes

The Time Slider is at the bottom of the screen, as shown in Figure 8-4. The Time Slider is used to change your position in time, counted in frames. As you read in the previous chapter, frames are the common increment for denoting time in an animation. You’ll read more about the Time Slider in the next chapter.

Figure 8-4: The Time Slider allows you to change your position in time and scrub your animation.

f0804.tif

You can click and drag the horizontal bar to change the frame in your animation on the fly. This is called scrubbing animation. The bar displays the current frame/end frame. By default, your 3ds Max UI may show a start frame of 0 and an end frame of 30. Let’s set the Time Slider to start at 0 and end at 100. To the right of the Time Slider, click the Time Configuration button, as shown in Figure 8-5.

Figure 8-5: Click the Time Configuration button.

f0805.tif

In the Time Configuration dialog box, set the End Time value to 100 as shown in Figure 8-6, and then click OK. Your Time Slider will change to show a range of 0 to 100 frames. Click and drag the slider to the left so your current frame is 0. Now, in the lower-right corner of the UI, click the Auto Key button, as shown in Figure 8-7. Both the Auto Key button and the Time Slider will turn red. This means that any movement in the objects in your scene will be recorded as animation. How exciting!

Figure 8-6: Set the End Time to 100.

f0806.tif

Figure 8-7: Auto Key button

f0807.tif

Move the Time Slider to the right to frame 20. Select the box on the left (the top parent) and move it across the Front viewport to the left along the X-axis. Next, click and move the middle box down on the Y-axis in the viewport, as shown in Figure 8-8.

Figure 8-8: Move the boxes at frame 20.

f0808.tif

Now scrub the timeline between 0 and 20, and you will see your animation. Even though you did not set any keyframes on the box to the right, it will follow along with both the left box and the middle box, doing a combination of their moves. The middle box goes with its parent (the left box) and its own animation, sliding down the viewport on the Y-axis. This is a simple hierarchy showing you how the relationships between objects build animation. You will use the same theory to build the animation for the Mobile exercise.

Before you continue on to the next exercise, make sure to turn off Auto Key.

Hierarchies for the Mobile

Set your 3ds Max project folder by choosing Application menu ⇒ Manage ⇒ Set Project Folder and selecting the Mobile project that you downloaded from this book’s companion web page (www.sybex.com/go/intro3dsmax2011) to your hard drive.

Let’s start with a simple hierarchy scheme much like the preceding Boxes exercise. Start with the Mobile_v01.max scene file in the MobileScenes folder in the Mobile project downloaded from this book’s companion web page.

You will create the hierarchies for the animation of the mobile using the following steps:

1. Remember, the Select and Link tool works from the children up the hierarchy to the top parent. You will link the shapes to their respective bars up the mobile. Click the Select and Link tool (i0801.tif) and then select the triangle. Drag the cursor to its bar, as shown in Figure 8-9. The triangle is now linked to the bar above it.

2. With the Select and Link tool still active, click and drag from the donut to the bar above it, as shown in Figure 8-10.

Figure 8-9: Drag from the triangle to link it to the bar.

f0809.tif

Figure 8-10: Link the donut to the bar.

f0810.tif

3. With the Select and Link tool, click and drag from the bottom bar that holds the triangle and donut to the square shape above it, as shown in Figure 8-11. The bar is hanging from that square as if this were a real mobile, so you would link it as such. If you want to check your work, select and move the square. The objects beneath it will move with the square. Just make sure to press Ctrl+Z to undo any moves you made to check the linking.

Figure 8-11: Link the bar to the square.

f0811.tif

4. Now you just need to use the same steps to link the rest of the mobile:

a. Click and drag with the Select and Link tool from the square to the bar above it.

b. Link from the star to its bar.

c. Link from the bar above the star and square to the top bar, as shown in Figure 8-12.

Figure 8-12: Link one bar to another.

f0812.tif

d. Link from the hexagon to its bar.

e. Link from the circle to its bar.

f. Link from the bar above the circle and hexagon to the top bar, as shown in Figure 8-13.

Figure 8-13: Link the circle’s bar to the top one.

f0813.tif

You can refer to Figure 8-14 for a diagram of the linking order. It doesn’t matter in what order you link the pieces, as long as you link from the bottom pieces up the chain.

Figure 8-14: The linking order determines the hierarchy of the mobile.

f0814.eps

Pivot Points

Figure 8-15: The bottom bar is rotating around its own end instead of its middle.

f0815.tif

Now you’ve linked all the pieces of the mobile and created your first animation hierarchy. It’s time to rotate parts of the mobile and test your handiwork. This will be the last step before you animate the mobile. To test the mobile, select the bottom bar and rotate it on the Z-axis in either direction. Figure 8-15 shows the rotation of the bottom bar. Notice that the Rotate gizmo is at one end of the bar and not in the middle. You should also notice that the bar (along with the triangle and donut) is rotating around the end of the bar, although it should rotate in the middle, where the string would be hanging it from the square right above it.

Your results might be slightly different from what is shown here. Your bar might not rotate around the same end or it might rotate somewhere else along the cylinder. This is perfectly normal. The important thing is where the pivot point of the object is—and that pivot should ultimately be in the middle of the bar.

Simply put, the pivot point of an object in 3ds Max is the point about which it rotates. It is also the point on the object that defines the point in coordinate space where the object resides. So a coordinate of (2, 6, 0) for the position of a cube, for example, technically describes the pivot point of that cube to be at the location (2, 6, 0).

Because the pivot point of the bottom bar is not in the middle of the bar, you will have to move the pivot point to the middle. To do so, follow these steps:

1. Use Ctrl+Z to undo any rotations you have already put on the bottom bar. Click the Move tool (i0802.tif) or press the hot key W for the Move tool, and select the bottom bar if it is not currently selected. In the Command panel, switch to the Hierarchy panel, as shown in Figure 8-16, by pressing the Hierarchy Panel tab (i0803.tif).

Figure 8-16: The Hierarchy panel

f0816.tif

2. At the top of the Hierarchy panel, make sure the Pivot button is active and then click the Affect Pivot Only button to activate it (the button will change color). This will tell 3ds Max to move only the pivot point of the currently selected object and not to move the entire object. Your gizmo will change, as shown in Figure 8-17.

3. Click the X-axis Move handle (the small red arrow inside the larger outline of an arrow) and move the pivot point along the length of the bar to the middle of the bar, as shown in Figure 8-18.

Figure 8-17: Again, the gizmo cues you to what action is being taken: You’re moving only the pivot point.

f0817.tif

Figure 8-18: Move the pivot to the middle of the bar.

f0818.tif

Figure 8-19: The bottom bar now rotates properly.

f0819.tif

4. In the Hierarchy panel, click the Affect Pivot Only button again to turn it off. Your cursor will return to the normal Move tool gizmo. Select the Rotate tool from the Main toolbar (i0804.tif) and rotate the bottom bar again. The bar will now rotate around its middle as it should, with the triangle and donut in tow, as shown in Figure 8-19.

5. To make sure the pivot points are all in the middle of the respective bars, check the other bars in the mobile. If necessary, use the previous steps to relocate the pivots to their proper places.

You can check your work against the Mobile_v03.max scene file in the MobileScenes folder from the companion web page. Once the pivot points are all placed properly on the mobile’s bars, you are ready to animate. Grab a cold drink; you deserve it!

Ready, Set, Animate!

In this animation, we will rotate only the bars of the mobile. Don’t worry about rotating or animating the shapes for now. We will revisit this exercise later in this chapter.

You can use your own file, or you can download the Mobile_v03.max scene file in the MobileScenes folder on the web page. In this file, the mobile is already linked properly for this animation and all the pivots are placed at the middle of each bar. To animate the mobile, follow these steps:

1. Scrub the Time Slider to 0. If it is not already on, turn on the Auto Keyframe feature by clicking the Auto Key button (i0805.tif). Both the Auto Key button and the Time Slider will turn red.

2. Move the Time Slider to frame 50. Click the Rotate tool (or press the hot key E for the Rotate tool), and select and rotate the bottom bar (which will also rotate the triangle and donut beneath it). You can rotate the bar in either direction on the Z-axis, as shown in Figure 8-20. Give it a few full rotations all the way around. Don’t be shy.

Figure 8-20: Rotate the bottom bar with some gusto!

f0820.tif

3. You can scrub the animation to check it out. The bottom bar and its shapes should be spinning. Make sure you go back to frame 50 in the Time Slider. With the Rotate tool still active, select the second bar from the bottom (the bar with the square and the star), and rotate it in either direction on the Z-axis. Figure 8-21 shows how the bottom bar follows along.

Figure 8-21: Rotate the second bar, and the bottom bar follows.

f0821.tif

4. While still at frame 50, select the third bar from the bottom (the bar with the circle and the hexagon) and rotate it in either direction on the Z-axis. The circle and hexagon rotate with the bar, as shown in Figure 8-22.

Figure 8-22: The shapes rotate properly.

f0822.tif

5. With the Rotate tool, select the top bar and rotate it in either direction on the Z-axis. The entire mobile will rotate along with it, because the top bar is the top parent of this hierarchy (Figure 8-23).

Figure 8-23: The whole mobile rotates along with the top bar.

f0823.tif

Scrub your animation, and you’ll see that the mobile is in full swing! The bars rotate and carry with them the shapes and bars beneath them, according to the previously set hierarchy. If your shapes or child bars are not rotating with their parent bars, check your hierarchies or redo that portion of the exercise. We will pick up animating the rest of the mobile in the next section.

You can use your own file, or you can download the Mobile_v04.max scene file in the MobileScenes folder on the web page.

Understanding the underlying technique used here is important, so doing the exercise more than once is not a bad idea. These things can be frustrating, so take it easy and when you get confused or stuck, back up and try again. For now, take a break, save your work and get ready for the next section.

Animating the Rest of the Mobile

Let’s pick up where you left off and finish the animation using the hierarchies that were just set up.

You can begin this exercise by using your own Mobile file, or you can download Mobile_v05.max from the MobileScenes folder in the Mobile project on the companion web page. This scene file is the same as the file you ended up with in the previous section (Mobile_v04.max), except this version takes the animation of the bars to frame 100 instead of frame 50, giving you a little more room to play.

Animating the Shapes

With the Mobile_v05.max scene open (or your own file), scrub through the animation to become familiar with the scene. The intent here is to create a hierarchy in the mobile and animate the bars. Now you will add rotation to the shapes hanging from the bars. Figure 8-24 shows the mobile in mid-animation.

Figure 8-24: The mobile!

f0824.tif

To add animation to the shapes under the bars, follow these steps:

1. Go to frame 0 of the animation, and click the Auto Key button (i0805.tif) at the bottom of the UI to turn it on if it’s off.

2. Select the triangle hanging from the bottom bar, and go to frame 50. Rotate the triangle on the Z-axis in either direction at least a full turn of 360 degrees, as shown in Figure 8-25. Don’t scrub your animation yet.

Figure 8-25: Rotate the triangle 360 degrees or more on the Z-axis.

f0825.tif

3. Still at frame 50, select the square on the bar above, and rotate that shape on the Z-axis several hundred degrees in either direction. Figure 8-26 shows the rotation of the square. The bottom bar goes along with the square’s rotation because this is how they were linked earlier in this chapter. Don’t scrub your animation yet.

4. Still at frame 50, select the star and rotate it several hundred degrees on the Z-axis in either direction (Figure 8-27).

Figure 8-26: The square is rotated, and its child bar goes along for the ride.

f0826.tif

Figure 8-27: Rotate the star on the Z-axis.

f0827.tif

Now scrub your animation and check the results. In theory, all the bars should rotate and so should the shapes hanging on the bars. When you scrub, however, the mobile will seem to have lost its mind. The shapes will rotate completely off-axis, as if you have set rotation keyframes on the X- and Y-axes as well as the intended Z-axis. The same will occur with the lower bar. It will go off its axis and rotate in an unpredictable manner. This behavior is explained in the next section, with easy solutions to fix the issue.

Making a Mistake

Have we gone mad? Why would we purposely show you an incorrect workflow? Because learning from missteps is as important to learning CG as learning the correct steps is. Being able to troubleshoot is essential to becoming good in CG, and the more trouble you get yourself into, the better you will become at digging your way out.

This example of strangely rotating hierarchies is an isolated issue that is called gimbal lock in many CG circles. Different CG packages have different ways of interpreting exactly how an object rotates when it is rotating along more than one axis. Imagine three cars all staring each other down at a three-way intersection—with the traffic light out. Who goes first in this situation is important to the flow of traffic at the intersection. When a 3D package calculates rotations, it needs to know which axis to rotate first before tending to the rotation of the other axes. In 3ds Max, the animation controller is the traffic light directing the animation. With gimbal lock, you have an incorrect interpretation of the rotations, so the resulting animation seems off-axis.

In this exercise, the multiple rotations inherited by the child shapes and bars from their parents caused havoc with their own rotations, so the axes became confused and everything looks just plain wrong. The easiest way to fix this issue is to reassign the animation controllers in charge of the rotations for those objects to one that will not lock up.

Animation Controllers

By default, 3ds Max assigns an Euler XYZ controller to the rotations of objects. This is the best controller to use in the majority of circumstances. In this example, however, it doesn’t quite work. To assign a different controller, follow along here:

1. Turn off Auto Key. Select the square; you will start with that object. Switch to the Motion panel (click the Motion tab—i0806.tif—in the Command panel, as you see in Figure 8-28). Open the Assign Controller rollout. You’ll see that the Rotation controller for the square is set to Euler XYZ.

2. Select Rotation: Euler XYZ from the list in the Motion panel, as shown in Figure 8-28. Click the Assign Controller button (i0807.tif, found right under the Assign Controller rollout heading) to open the Assign Rotation Controller dialog box (Figure 8-29). Choose TCB Rotation from the list then click OK. If you do not first select the controller from the Controller list, the Assign Controller button will be grayed out and unusable.

Figure 8-28: The Assign Controller rollout in the Motion panel.

f0828.tif

Figure 8-29: Choosing TCB Rotation limits your options and the rotation.

f0829.tif

3. The square and the bar linked beneath it should snap back into axis. Scrub the animation, and you’ll see that the square and the bar beneath it are behaving as you would expect: They are rotating on the Z-axis only, as they should. Figure 8-30 shows the resulting animation. Notice that the star and triangle are still rotating off-axis.

4. Select the triangle and repeat steps 2 and 3 to assign a TCB Rotation controller to the triangle. Do the same for the star. Figure 8-31 shows the proper rotations of the shapes and the bars—but looks are deceiving. We’re not done yet!

If Euler XYZ caused such a ruckus, why isn’t TCB Rotation the default for rotating objects? For one thing, the editing options you have with an Euler XYZ controller are head and shoulders above what you get with TCB Rotation. With Euler XYZ, 3ds Max splits the XYZ rotation animation into three separate tracks to give individual control over each axis. This is ideal.

Figure 8-30: You’ve fixed the rotation of the square and its children.

f0830.tif

Figure 8-31: The mobile seems to rotate properly, but does it really?

f0831.tif

In addition, the TCB Rotation has taken the several hundred degrees of rotation you have animated, and cut it down to keep values under 180 degrees of rotation at most. The square, triangle, and star don’t seem to be rotating the several hundred degrees you intended.

It is not a good idea to change the default animation controllers based solely on your experience with this exercise. On the other hand, if you run into a gimbal lock situation in the future, you’ll have a good idea what caused it, and you’ll be able to troubleshoot it quickly.

Editing the TCB Rotation Keyframes

To fix the problem of the objects not rotating the several hundred degrees you want, you will have to manually edit the controller to allow a greater degree of rotation:

1. Select the square and open the Key Info rollout (Figure 8-32). Go to frame 0.

Figure 8-32: Edit your controller in the Key Info rollout.

f0832.tif

2. The Key Info rollout shows you the properties of the animation on the selected object on a key-by-key basis. If everything is grayed out, use the arrows at the top of the rollout to move through the keyframes. Go to the first keyframe at frame 0 (shown as Time: 0 in the rollout). The Angle displays the orientation of the square at the beginning of the animation: 120. Use the arrows at the top of the rollout again to move to keyframe 2 (Time: 50).

3. The Angle parameter should change to a value of 117.643 (your value may differ, as long as the rotation looks correct). The X parameter value reads –1.0. The X, Y, and Z parameters represent the direction in the respective axes. The value –1 means the square is rotating backward. Don’t get confused because this value is now in X and not Z. Remember, you gave up the individual controls for X, Y, and Z when you changed from the Euler XYZ controller. While at this second keyframe (at frame 50), check Rotation Windup at the bottom of the rollout, and enter the value 500 for Angle. You must first turn on Rotation Windup to enter 500 for the Angle (Figure 8-33).

Figure 8-33: Adding more rotation to the square in the Key Info rollout

f0833.tif

4. Scrub your animation, and the square will rotate more, as you first intended. Repeat steps 2 and 3 for the triangle and star to fix their rotations with the TCB Rotation controller. At this point, you can save the 3ds Max file for use in the next section.

Any parameter that is animated has a controller. A controller essentially deals with all the animation functions in the scene for 3ds Max, such as storing keyframe values. Interpolating in-betweens is handled by the controllers. By default, the Position XYZ controller is assigned to an animation on an object’s position and an Euler XYZ is assigned to its rotation. These controllers are the most useful as they split the X, Y, and Z into separate tracks to give individual control over each axis. You will have the opportunity to work with and edit individual tracks later in this chapter.

Using Dummy Objects

The preferred way to circumvent this particular issue of rotation confusion is by using helper objects in 3ds Max called dummy objects. Changing the controller for an object is not always the best solution—particularly if the range of movement will be changed. You saw this problem when you changed to TCB Rotation before you had to fix it in Key Info to add more rotation. Using dummy objects, you can insert a helper in the hierarchy that will negate the gimbal lock issue and make it very clear to 3ds Max how the rotations should proceed. As a matter of fact, it’s common for animators to make copious use of dummies as controllers for their animation rigs. A rig is essentially any setup in the scene that helps you animate objects in the scene.

Dummies (called null nodes in other CG applications, such as Maya) are very useful nonrendering objects that can be used in several ways. In this case, they serve as placeholders and are used directly in the hierarchy to straighten out the rotation confusion. They serve as parents to the mobile shapes that may come down with rotation confusion or gimbal lock.

The Way to Really Set Up the Mobile: Placing Dummies in the Hierarchy

You can begin this exercise either by using your own Mobile file before the steps in the last section or by opening Mobile_v06.max from the Scenes folder in the Mobile project you downloaded from the companion web page to your hard drive.

To create dummy objects for the animation hierarchy, follow these steps:

Figure 8-34: Click Dummy (left). This creates a dummy object to fit over the circle (right).

f0834.tif

1. Go to the Create Panel. Click on the Helpers button (i0808.tif), and click on Dummy (Figure 8-34).

2. Go to Frame 0. There are no Parameter rollouts or settings for the dummy. Move your cursor to the Front viewport, center it over the circle, and then click and drag to create a dummy like the one in the top of Figure 8-34. Create a dummy that is slightly larger than the circle.

Linking the Dummies

If you scrub the animation, you will notice that the circle moves along with the rotation of its parent bar, as it did before. This is because the dummy is not part of the hierarchy yet. You are going to change the structure of the hierarchy in order to break the relationship of the circle with its parent object and restructure it to add the dummy between the bar and the circle. This is done by relinking the new order.

3. Make sure the Time Slider is at frame 0. Go to the Main toolbar and click on the Select and Link tool (i0801.tif). Use the Select and Link tool to select the circle, and then click and drag it to its dummy object. Make sure you don’t let go until the cursor changes to the icon to make the proper link, as shown in Figure 8-35.

Figure 8-35: Drag to link from the circle to the dummy object.

f0835.tif

To jump to the beginning of an animation, just press the Home key on your keyboard; this is a shortcut to jump to the start. Likewise, pressing the End key will take you to the end of an animation.

4. You’re not done yet. If you scrub the animation, the circle will no longer move with its parent bar. You have to link the dummy to the bar. Select the dummy, and click and drag to the parent cylinder (Figure 8-36). This completes the new hierarchy. Now the circle is the child of the dummy, and the dummy is the child of the parent bar above it. Play the animation, and you will see the dummy moving along with the mobile, with the circle in tow.

Figure 8-36: Link the circle’s dummy to the bar.

f0836.tif

5. Fantastic! Now it is time to animate the circle itself. Move to the end of your timeline (frame 100; press the End key), and click the Auto Key button at the bottom of the interface (you can also press the N key to toggle Auto Key on and off). Select the circle, and rotate a few hundred degrees on the Z-axis in either direction. Do not rotate the dummy, just the circle. Figure 8-37 shows how the circle rotates within the dummy, which then follows the bar’s rotation.

Figure 8-37: Success! The circle is now rotating properly.

f0837.tif

6. Repeat steps 1 and 2 to create dummies for the other objects in the mobile. Relink the objects to their dummies, as you did in steps 3 and 4. Animate the shapes themselves to your heart’s content as in step 5. If you see funky rotation on the dummies and objects, either you have made an error in the linking order, or you have animated the dummies rotating and not the shapes themselves.

Play the animation. As you can see, the funky rotation is gone and now you have a perfectly normal rotation without having to change the animation controllers. The bar’s rotation moves the dummy below it, and the dummy pulls the circle. Because the bar is not directly pulling the circle, the circle is free to rotate without rotation confusion.

Once you feel confident with how this exercise works, you should have a pretty solid idea of how hierarchies work in animation. Feel free to go through this entire exercise another time before moving on.

Editing Dummies—Using the Align Tool

Each dummy gets its orientation from the viewport in which you create it. When you place one of the mobile’s dummies, you don’t need to have it aligned perfectly with the shape for which the dummy is being used. However, it is a good idea to match things up as best as you can to keep track of which dummy goes with which shape.

Let’s say you created a dummy and it is nowhere near its object. The Align tool can move the dummy so it is centered on the object. To see how the Align tool works, follow along with these steps:

1. Turn off Auto Key and go to Frame 0. Create a dummy of any size anywhere in the mobile scene (Figure 8-38).

2. Make sure the dummy is selected. Go to the Main toolbar and select the Align tool (i0809.tif). Move your cursor to the hexagon to which you want to align the dummy, and click the hexagon. The Align Selection dialog box will open (Figure 8-39).

Figure 8-38: Create a dummy.

f0838.tif

Figure 8-39: The Align Selection dialog box.

f0839.tif

3. The Align Selection dialog box gives you the choice of aligning an object along any axis, orienting the object (this feature is for rotations), and aligning for the object’s scale. Keep the checks on in the X, Y, and Z Position boxes, but change the Current and Target Object to Center and then press OK. The dummy will match up with the hexagon shape as shown in Figure 8-40.

Figure 8-40: Aligned to center

f0840.tif

Although it may seem like more work, using dummies is a great workflow for animation. It keeps the scene’s animation neater and better defined. As you gain more experience, you will begin to learn when you should use dummies in your hierarchy to make the animation workflow smooth.

The Bouncing Ball

A classic exercise for all animators is to create a bouncing ball. As a matter of fact, you will find bouncing ball tutorials almost everywhere you look. Although you will see it as a straightforward exercise, there is so much you can do with a bouncing ball to show character that the possibilities are almost limitless. Animating a bouncing ball is a good exercise in physics as well as cartoon movement. You’ll first create a rubber ball, and then you’ll add cartoonish movement to accentuate some principles of the animation techniques discussed in Chapter 1, “Basic Concepts.” Aspiring animators will be able to use this exercise for years and always find something new to learn about bouncing a ball.

In preparation, download the Bouncing Ball project from the companion web page to your hard drive. Set your current project by choosing Application menu ⇒ Manage ⇒ Set Project Folder and selecting the Bouncing Ball project that you downloaded.

Animating the Ball

Your first step is to keyframe the positions of the ball. As introduced in Chapter 1, keyframing is the process—borrowed from traditional animation—of setting positions and values at particular frames of the animation. The computer interpolates between these keyframes to fill in the other frames to complete a smooth animation.

Open the Animation_Ball_00.max scene file from the BouncingBallScenes folder you downloaded.

You’ll start with the gross animation, or the overall movements. This is also widely known as blocking. First, move the ball up and down to begin its choreography.

Figure 8-41: At frame 10, move the ball to meet the ground plane.

f0841.tif

Follow these steps to animate the ball:

1. The first thing you need to do in this scene is to move the pivot point for the ball from the center of the ball to the bottom of the ball. Select the ball, then go to the Hierarchy panel (i0803.tif). Choose Pivot, and under the Adjust Pivot rollout, click the Adjust Pivot Only button. Zoom in on the ball in the Front viewport and move the pivot so that it is at the bottom of the ball. Then click on the Affect Pivot Only button again to deactivate—but you already knew that.

2. Turn on the Auto Key button (keyboard shortcut N) and move the Time Slider to frame 10. With the ball selected, move it along the Z-axis down to the ground plane. That will be 0 units on Z when you release the mouse button in the Transform Type-In at the bottom of the interface. You can also just enter the value and press Enter (Figure 8-41).

This has created two keyframes, one at frame 0 for the original position the ball was in, and one at frame 10 for the new position to which you just moved the ball.

Copying Keyframes

Now you want to move the ball up to the same position in the air as it was at frame 0. Instead of trying to estimate where that was, you can just copy the keyframe at frame 0 to frame 20.

You can see the keyframes you created in the timeline. They are red boxes in the timeline. Red keys represent Position keyframes, green keys represent Rotation, and blue keys represent Scale. When a keyframe in the timeline is selected, it turns white. In Figure 8-42, the keyframe at frame 0 is selected and is white.

Figure 8-42: The selected key in the timeline is white.

f0842.tif

1. Select the keyframe at frame 0; it should turn white when it is selected. Hold down the Shift key on the keyboard (this is a shortcut for the Clone tool), and click and drag the selected keyframe to move it to frame 20. This will create a keyframe with the same animation parameters as the keyframe at frame 0.

2. Click and drag on the Time Slider to scrub through the keyframes. Turn off Auto Key.

Using the Track View–Curve Editor

Right now the ball is going down and then back up. To continue the animation for the length of the timeline, you could continue to copy and paste keyframes—but that would be very time-consuming, and you still need to do your other homework and clean your room. A better way is to loop or cycle through the keyframes you already have. An animation cycle is a segment of animation that is repeatable in a loop. The end state of the animation matches up to the beginning state, so there is no hiccup at the loop point.

In 3ds Max, cycling animation is known as Parameter Curve Out-of-Range Types. This is a fancy way to create loops and cycles with your animations and specify how your object will behave outside the range of the keys you have created. This will bring us to the Track View, which is an animator’s best friend. You can go through the Track View’s UI in the “Track View” section later in this chapter at any time, or you can hang tight and see how you work with Curve Editor first using the Bouncing Ball exercise. You will learn the underlying concepts of the Curve Editor as well as its basic UI throughout this exercise. Feel free to reference the “Track View” section as you continue.

The Track View is a function of two animation editors, the Curve Editor and the Dope Sheet. The Curve Editor allows you to work with animation depicted as curves on a graph that sets the value of a parameter against time. The Dope Sheet displays keyframes over time on a horizontal graph, without any curves. This graphical display simplifies the process of adjusting animation timing because you can see all the keys at once in a spreadsheet-like format. The Dope Sheet is similar to the traditional animation exposure sheets or X Sheets.

Navigation inside the Track View–Curve Editor is pretty much the same as navigating in a viewport; the same keyboard/mouse combinations work for panning and zooming.

You will use the Track View–Curve Editor (or just Curve Editor for short) to loop your animation in the following steps:

1. With the ball selected, in the menu bar choose Graph Editors ⇒ Track View - Curve Editor. In Figure 8-43, the Curve Editor displays the animation curves of the ball so far.

Figure 8-43: The Curve Editor shows the animation curves of the ball.

f0843.tif

2. A toolbar runs across the top of the Curve Editor under the menu bar. In that toolbar, click the Parameter Curve Out-of-Range Types button (i0810.tif), shown in context in Figure 8-44.

Figure 8-44: Parameter Curve Out-of-Range Types button

f0844.tif

3. This will open the Param Curve Out-of-Range Types dialog box (Figure 8-45). Select Loop from this dialog box by clicking its thumbnail. The two little boxes beneath it will highlight. Click OK. To read up on the other Parameter Curve Out-of-Range Types available, see the “Parameter Curve Out-of-Range Types” sidebar later in this chapter.

Figure 8-45: Choosing to loop your animation

f0845.tif

4. Once you set the curve to Loop, the Curve Editor displays your animation as shown in Figure 8-46. The out-of-range animation is shown as a dashed line. Scrub your animation in a viewport and see how the ball bounces up and down throughout the timeline range.

Figure 8-46: The Curve Editor now shows the animation looped curve.

f0846.tif

Reading Animation Curves

As you can see, the Track View–Curve Editor (from here on called just the Curve Editor) gives you control over the animation in a graph setting. Curves allow you to visualize the interpolation of the motion. Understanding what animation curves do in the Curve Editor is critical to getting your animation to look right. Once you are used to reading animation curves, you can judge an object’s direction, speed, acceleration, and timing at a mere glance.

The Curve Editor’s graph is a representation of an object’s parameter, such as position (values shown vertically) over time (time shown horizontally). Every place on the curve represents where the object is; a keyframe does not need to be on the curve. So, the shape of the curve makes a big difference in the motion of the object.

Here is a quick primer on how to read a curve in the Curve Editor.

In Figure 8-47, an object’s Z Position parameter is being animated. At the beginning, the curve quickly begins to move positively (that is, to the right) on the Z-axis. The object shoots up and comes to an ease-out, where it decelerates to a stop, reaching its top height. The ease-out stop is signified by the curving beginning to flatten out at around frame 70.

Figure 8-47: The object quickly accelerates to an ease-out stop.

f0847.tif

Parameter Curve Out-of-Range Types

There are several ways to interpret the curves of an animation when they are out of range, meaning when they extend before your first keyframe and beyond your last keyframe. The Parameter Curve Out-of-Range Types dialog box is opened through the Curve Editor with this toolbar button (i0810.tif). The types are the following:

Constant Used when you do not want any animation out of range. This curve type will hold the value of the end and/or beginning key of the range for all frames. Constant is the default out-of-range type.

Cycle Used when you need the animation to loop or cycle by repeating the same animation that is within the range. If the first keyframe does not line up with the last keyframe of the curve range, there will be an abrupt “jump” from the last key to the first with every cycle. If the start and end values do not need to match, and that hiccup in the cycle is desired, use Cycle.

Loop Used when you need the animation to loop or cycle smoothly despite any differences in the start and end keyframe values. Loop repeats the same animation in the curve range, but it also interpolates between the last and first keyframes in the range to create a smooth loop in the cycle. Loop’s ability to create a smooth loop can go only so far before it acts like a Cycle (e.g., when the key values at the start and end are too disparate).

Ping Pong Used when you want your animation to oscillate back and forth. Ping Pong repeats the same animation in the range, but it plays it front to back and then back to front, and so forth, to alternate the playback, as shown here.

g0801.tif

Linear Used when you need your animation to continue at the same speed as its beginning or end. The animation curve is projected out from the range in a straight line, picking up the trajectory from the shape of the start or end of the curve, as shown here.

g0802.tif

Relative Repeat Used when you need your animation to repeat as in a cycle and to continue building on itself as it cycles. Each repetition is offset by the value at the end of the range, as shown here.

g0803.tif

You can select any one of these types for either the before or after by clicking one of the smaller boxes below the thumbnails. You can set both the before and after out-of-range type by clicking the thumbnail of the type itself.

In Figure 8-48, the object slowly accelerates in an ease-in in the positive Z direction until it hits frame 75, where it suddenly stops.

Figure 8-48: The object eases in to acceleration and suddenly stops at its fastest velocity.

f0848.tif

In Figure 8-49, the object eases in and travels to an ease-out where it decelerates, starting at around frame 69, to where it slowly stops, at frame 75.

Figure 8-49: Ease-in and ease-out

f0849.tif

Finally, in Figure 8-50, the object jumps from its Z Position in frame 24 to its new position in frame 25.

Figure 8-50: Step interpolation makes the object “jump” suddenly from one value to the next.

f0850.tif

Figure 8-51 shows the Track View–Curve Editor, with its major aspects called out for your information. See the “Track View” section later in this chapter for a more thorough explanation of the UI and toolset for the Track View.

Figure 8-51: The Curve Editor

f0851.eps

Refining the Animation

Now that you’ve played back the gross animation of the bounce, how does it look? Not like a ball bouncing, really, but the framework is getting there. Notice how the speed of the ball is consistent. If this were a real ball, it would be dealing with gravity; the ball would speed up as it gets closer to the ground and there would be “hang time” when the ball is in the air on its way up as gravity takes over to pull it back down.

This means you have to edit the movement that happens between the keyframes. This is done by adjusting how the keyframes shape the curve itself, using tangents. When you select a keyframe, a handle will appear in the UI, as shown in Figure 8-52 and close up in Figure 8-53.

Figure 8-52: The ball’s animation curve

f0852.tif

Figure 8-53: The keyframe’s handle

f0853.tif

This handle adjusts the tangency of the keyframe to change the curvature of the animation curve, which in turn changes the animation. There are different types of tangents, depending on how you want to edit the motion. By default the Smooth tangent is applied to all new keyframes. This is not what you want for the ball, although it is a perfect default tangent type to have.

Editing Animation Curves

Figure 8-54: The Open Mini Curve Editor button

f0854.tif

Let’s edit some tangencies to better suit your animation. The intent is to speed up the curve as it hits the floor and slow it down as it crests its apex. Instead of opening the Curve Editor through the menu bar, this time you are going to use the shortcut. At the bottom-left corner of the interface, click the Open Mini Curve Editor button shown in Figure 8-54. You may have to close the large Curve Editor dialog first.

This Mini Curve Editor is almost exactly the same as the one you launch through the Main Menu bar. A few tools are not included in the Mini Curve Editor toolbar, but you can find them in the menu bar of the Mini Curve Editor. Figure 8-55 shows the Mini Curve Editor open in the 3ds Max UI.

Figure 8-55: The Mini Curve Editor

f0855.tif

To edit the curves, follow these steps:

1. Scroll down the List Controller window on the left of the Mini Curve Editor by dragging the Pan tool (the hand cursor) to find the Ball object’s position. Click on the Z Position track. This will bring only those curves to the Key Editing window that you want to edit, as you saw in Figure 8-55.

2. The Z Position curve is blue, as is almost everything relating to the Z-axis. The little gray boxes on the curves are keyframes, as you saw in Figure 8-51. Select the keyframe at frame 10. You may need to scrub the Time Slider out of the way if you are on frame 10. The key will turn white when selected. Remember, if you need to zoom or pan in the Curve Editor’s Key Editing window, you can use the same shortcuts you would use to navigate in the viewports. You will change this key’s tangency to make the ball fall faster as it hits and bounces off the ground.

3. In the Mini Curve Editor toolbar, change the tangent type for the selected keyframe from the Auto default to Fast by selecting the Set Tangents to Fast icon (i0811.tif). When you do this, you will see the animation curve change shape as shown in Figure 8-56.

Figure 8-56: The effect of the new tangent type

f0856.tif

4. Select the Camera viewport and play the animation. You can easily correlate how the animation works with the curve’s shape as you see the Time Slider travel through the Mini Curve Editor as the animation plays.

Finessing the Animation

Although the animation has improved, the ball has a distinct lack of weight. It still seems too simple and without any character. In situations such as this, an animator can go wild and try several different things as he or she sees fit. This is where creativity helps hone your animation skills, whether you are new to animation or have been doing it for 50 years.

Animation shows change over time. Good animation conveys the intent, the motivation for that change between the frames.

Squash and Stretch

The concept of squash and stretch has been an animation staple for as long as there has been animation. It is a way to convey the weight of an object by deforming it to react (usually in an exaggerated way) to gravity, impact, and motion.

You can give the ball a lot of flare by adding squash and stretch to give your object some personality. Follow along with these steps:

1. The Auto Key Animation button should still be active. If it isn’t, press the N key to activate it. In the Mini Curve Editor, drag the yellow double-line Time Slider (called the Track Bar Time Slider) to frame 10. (See Figure 8-57.) Click and hold the Scale tool to access the flyout. Choose the Select and Squash tool (i0809.tif). Center the Scale cursor over the Z-axis of the Scale Transform gizmo in the Camera viewport. Click and drag down to squash down about 20 percent. This will scale down on the Z-axis and scale up on the X- and Y-axes to compensate (Figure 8-58).

Figure 8-57: Dragging the Time Slider

f0857.tif

2. Move to frame 0. Click and drag up to stretch the ball up about 20 percent (so that the ball’s scale in Z is about 120), as shown in Figure 8-59. Adjust your viewport as necessary so you don’t move the ball out of frame. When you scrub through the animation, you will see that at frame 0 the ball stretched and then the ball squashes and stays squashed for the rest of the time. You’ll fix that in the next step.

Figure 8-58: Use the Squash tool to squash down the ball on impact.

f0858.tif

Figure 8-59: Stretch the ball when it is at its apex.

f0859.tif

You need to copy the Scale key from frame 0 to frame 20 first, and then apply a loop for the Parameter Out-of-Range Type. Because the Mini Curve Editor is open, it obstructs the timeline; therefore, you should copy the keys in the Mini Curve Editor. You can just as easily do it in the regular Curve Editor in the same way:

3. In the Mini Curve Editor, scroll in the Controller window until you find the Scale track for the ball. Highlight it to see the keyframes and animation curve. Click and hold the Move Keys tool in the Mini Curve Editor toolbar (i0815.tif) to roll out and access the Move Keys Horizontal tool (Figure 8-60).

Figure 8-60: Select the Move Keys Horizontal tool.

f0860.tif

4. Click and drag a selection marquee around the two keyframes at frame 0 in the Scale track to select them. Hold the Shift key, and then click and drag the keyframes at frame 0 to frame 20 (Figure 8-61).

Figure 8-61: Use the Move Keys Horizontal tool to drag the selected scale keyframes.

f0861.tif

5. In the Mini Curve Editor’s menu bar, select Controller ⇒ Out-of-Range Types. Choose Loop, and then click OK. Play the animation. The curves are shown in Figure 8-62.

Figure 8-62: The final curves

f0862.tif

Setting the Timing

Figure 8-63: Close the Mini Curve Editor.

f0863.tif

Well, you squashed and stretched the ball, but it still doesn’t look right. That is because the ball should not begin to squash too long before it hits the ground. It needs to return to 100 percent scale and stay there for a few frames. Immediately before the ball hits the ground, it can squash into the ground plane to heighten the sense of impact. The following steps are easier to perform in the regular Curve Editor rather than in the Mini Curve Editor. Close the Mini Curve Editor by clicking the Close button shown in Figure 8-63.

Open the Curve Editor to fix the timing, and follow these steps as if they were law:

1. Move the Time Slider to frame 8; Auto Key should still be active. In the Curve Editor, in the Controller window select the ball’s Scale track so that only the scale curves appear in the Editing window. In the Curve Editor’s toolbar, select the Add Keys button (i0812.tif). Your cursor will change to an arrow with a white circle at its lower right. Click on one of the Scale curves to add a keyframe on all the Scale curves at frame 8. Because scales X and Y are identical, you will see only two curves instead of three.

2. Because they are selected, the keys will be white. In the Key Status tools, you will find two text type-in boxes. The box on the left is the frame number, and the box on the right is the selected key’s (or keys’) value. Because more than one key with a different value is selected, there is no number in that type-in box. Enter 100 (for 100 percent scale) in the right type-in box, and 3ds Max will enter a value of 100 for the scale in X, Y, and Z for the ball at frame 8, as shown in Figure 8-64.

3. Move the Time Slider to frame 12, and do the same thing in the Curve Editor. These settings are bracketing the squash so that the squash happens only a few frames before and a few frames after the ball hits the ground, as shown in Figure 8-65. Press the N key to deactivate Auto Key. Save your work.

Figure 8-64: Enter a scale of 100.

f0864.tif

Figure 8-65: Much less squash!

f0865.tif

Once you play back the animation, the ball will begin to look a lot more like a nice cartoonish one, with a little character. Experiment with changing some of the scale amounts to have the ball squish a little more or less, or stretch it more or less to see how that affects the animation. See if it adds a different personality to the ball. If you can master a bouncing ball and evoke all sorts of emotion with your audience, you will be a great animator indeed.

Moving the Ball Forward

Make sure you set your current project to the Bouncing Ball project. Then you can load the Animation_Ball_01.max scene file from the Bouncing Ball project folder on your hard drive (or from the companion web page ) to catch up to this point or to check your work.

Now that you have worked out the bounce, it’s time to add movement to the ball so that it moves across the screen as it bounces. Layering animation in this fashion, where you settle on one movement before moving on to another, is common. That’s not to say you won’t need to go back and forth and make adjustments through the whole process, but it’s generally nicer to work out one layer of the animation before adding another. The following steps will show you how:

1. Move the Time Slider to frame 0. Select the ball with the Select and Move tool, and move the ball in the Camera viewport to the left so it is still within the camera’s view. That’s about –30 units on the X-axis (Figure 8-66).

2. Move the Time Slider to frame 100. Press the N key to activate Auto Key again. Move the ball to the right to about 30 units along the X-axis.

3. Don’t play the animation yet; it isn’t going to look right. Go to the Curve Editor, scroll down in the Controller window, and select the X Position track for the ball (Figure 8-67).

When you created the keyframes for the up and down movement of the ball (which was the Z-axis), 3ds Max automatically created keyframes for the X and Y Position tracks, both with essentially no value. To fix it, keep following these steps:

4. Select the keyframes on the X Position track at frame 10 and frame 20, and delete them by pressing the Delete key on your keyboard.

Figure 8-66: At frame 0, move the ball to the left side of the viewport.

f0866.tif

Figure 8-67: The X position of the ball does not look right.

f0867.tif

5. Select the Parameter Curves Out-of-Range Types button (i0810.tif), and select Constant. This will remove the loop from the X Position track but won’t affect the Z Position track for the ball’s bounce (Figure 8-68). Press the N key to deactivate Auto Key. Play the animation. You can use the / (slash) button as a shortcut to play the animation.

Figure 8-68: The X Position curve for the ball’s movement

f0868.tif

6. There is still a little problem. Watch the horizontal movement. The ball is slow at the beginning, speeds up in the middle, and then slows again at the end. It eases in and eases out, as you can see in the curve in Figure 8-68. This is caused by the default tangent, which automatically adds a slowdown as the object goes in and out of the keyframe. In the Curve Editor, select both keys for the X Position Curve and click on the Linear Tangent (i0813.tif) to create a straight line of movement so there is no speed change in the ball’s movement left to right.

Figure 8-69 shows the proper curve.

Figure 8-69: The X Position curve for the ball’s movement now has no ease-in or ease-out.

f0869.tif

Adding a Roll

Figure 8-70: The ball will not rotate properly because the pivot is at the bottom.

f0870.eps

You need to add some rotation, but there are several problems with this. One, you moved the pivot point to the bottom of the ball in the very first step of the exercise. You did that so the squashing would work correctly—that is, it would be at the point of contact with the ground. If you were to rotate the ball with the pivot at the bottom, it would look like Figure 8-70.

Using the XForm Modifier

You need a pivot point at the center of the ball, but you can’t just move the existing pivot from the bottom to the middle—it would throw off all the squash and stretch animation. Unfortunately, an object can have only one pivot point. To solve the issue, you are going to use a modifier called XForm. This modifier has many uses. You’re going to use it to add another pivot to the ball in the following steps:

1. Double-check that Auto Key is deactivated. The button is red when it is active.

Select the ball. From the menu bar, select Modifiers ⇒ Parametric Deformers ⇒ XForm. You may also select it from the Modifier List from the Modify panel. XForm will be added to the ball in the Modifier Stack, and an orange bounding box will appear over the ball in the viewport. XForm has no parameters, but it does have sub-objects, as you can see in Figure 8-71.

Figure 8-71: The XForm modifier in the Modifier Stack

f0871.tif

2. Expand the Modifier Stack by clicking the black box with the plus sign next to XForm. Then click Center. In the next step you will use the Align tool to center the XForm’s center point on the ball.

3. Click the Align tool, and then click on the ball. In the dialog box, make sure the check boxes for X, Y, and Z Position are checked, which means those axes are active. Now click Center under Target Object, and then press OK. The XForm’s center will move, as shown in Figure 8-72.

Now to be clear, this isn’t a pivot point. This is the center point on the XForm modifier. If you go to the Modifier Stack and click on the sphere, the pivot point will still be at the bottom, as shown in Figure 8-73.

Figure 8-72: Moving the XForm’s center

f0872.tif

Figure 8-73: The sphere’s pivot point is still at the bottom.

f0873.tif

The XForm modifier allows the ball to rotate without its squashing and stretching getting in the way of the rotation. By separating the rotation animation for the ball’s roll into the modifier, the animation on the sphere object is preserved.

Animating the XForm Modifier

To add the ball’s roll to the XForm modifier, follow along with these steps:

1. Turn on Auto Key and choose the Select and Rotate tool.

2. In the Modifier Stack, click on Gizmo for the sub-object of XForm. This is a very important step because it tells the modifier to use the XForm’s center instead of using the pivot point of the ball.

3. Move the Time Slider to frame 100 and rotate the ball 360 degrees on the Y-axis (you can use Angle Snap Toggle to make it easier to rotate exactly 360 degrees). Click on the XForm modifier to deactivate the sub-object mode. Play the animation.

The Ball Doesn’t Rotate 360 Degrees!

If you rotate the ball in step 3 360 degrees but the ball does not animate, 3ds Max could potentially be interpreting 360 degrees to be 0 degrees in the Curve Editor, thereby creating a flat curve. If this is the case, you can try rotating the ball 359 degrees instead to force the animation to work. You could also manually change the value in the Curve Editor for the keyframe at frame 100 to be a value of 360.

The ball should be a rubbery cartoon ball at this point in the animation. Just for practice, let’s say you need to go back and edit the keyframes because you rotated in the wrong direction and the ball’s rotation is going backward. Fixing this issue requires you to go back into the Curve Editor as follows:

Open the Curve Editor (mini or regular). Scroll down in the Controller window until you see the Ball tracks. Below the Ball’s Transform track is a new track called Modified Object. Expand the track by clicking on the plus sign in the circle next to the name. Go to the Gizmo track and select the Y Rotation track (Figure 8-74).

Figure 8-74: The XForm’s gizmo selected in the Controller window

f0874.tif

You will see the Function curve in the Edit Keys window. You want the keyframe at frame 0 to have the value 0 and the keyframe at frame 100 to be 360 degrees. Select both keyframes and change the tangents to Linear, as shown in Figure 8-75.

Close the Curve Editor and play the animation. Play the bounce ball.avi QuickTime movie file located in the RenderOutput folder of the Bouncing Ball project to see a render of the animation. You can also load the Animation_Ball_02.max scene file from the BouncingBall project folder to check your work.

Figure 8-75: Setting the rotation of the ball

f0875.tif

Bouncing Ball Summary

Working with the bouncing ball gave you quite a bit of experience with the 3ds Max’s animation toolset. There are several ways to animate a bouncing ball in 3ds Max. It is definitely a good idea to try this exercise a few times at first, and then to come back to it later—after you have learned other 3ds Max techniques.

If you are interested in seeing the differences in workflow between 3ds Max and Maya, you can see how to animate the bouncing ball with a similar ball exercise in Introducing Maya 2011 (Sybex, 2010).

Track View

As you have already seen, the Track View–Curve Editor is a powerful tool for creating and editing your animation scenes. In this section, the user interface for the Track View is laid out and explained as a brief reference for you. Figure 8-76 shows the Track View–Curve Editor.

Figure 8-76: The Track View–Curve Editor

f0876.eps

The Curve Editor can be a bit daunting at first. Now that you’ve had some experience with it in this chapter, it should seem pretty straightforward. The left side of the window (called the Controller window) displays the objects in the scene in an outline format. These objects have subheadings called tracks under them. Each track will define animation on one axis of movement or rotation or scale, or one parameter that is keyframed. When you click on a track, its animation information will display in the graph area on the right. In the Curve Editor, you can access the curves and keyframes to edit the animation. In the Dope Sheet version of the Track View, you can access keys in a different manner, as discussed in the next chapter.

You can switch between the Curve Editor and the Dope Sheet by selecting the desired window in the Modes menu in the Track View menu bar. Most of the tools discussed here are also accessible through the menu bar and the toolbars. The toolbars are divided into function sets.

Key Tools Toolbar

The following table lists the tools used in editing keys in the Curve Editor window. You used a few of these tools in the Bouncing Ball animation.

Icon Name Function
i0814.tif Filters Filters the display in the Curve Editor to make viewing complicated scenes easier.
i0815.tif Move Keys Lets you select a keyframe and move it freely in the graph.
i0816.tif Move Keys Horizontal Lets you select a keyframe and move it horizontally to change its timing only.
i0817.tif Move Keys Vertical Lets you select a keyframe and move it vertically to change its value only.
i0818.tif Slide Keys Lets you select keyframes and move the group, and slide the adjacent keys away as you move the group.
i0819.tif Scale Keys Lets you select keys and scale them to expand or compress the amount of time between them.
i0820.tif Scale Values Lets you select keys and increase or decrease the values of the keys proportionally without moving them in time.
i0821.tif Add Keys Add keys to an existing animation by clicking a curve.
i0822.tif Draw Curves Draw new curves or revise existing curves by drawing directly on the animation curve graph.
i0823.tif Reduce Keys Reduce keys when you have more keys than necessary on a curve.

Key Tangency Toolbar

As you saw with the bouncing ball, changing the tangency on a few keys can dramatically alter the look of your animation. By default, new keys are set to Auto tangents, which generally keep the curve smooth. 3ds Max sets an appropriate tangency automatically; however, you can easily change the tangency by manually moving the handles on the keyframes. Once you select an Auto tangent’s handle, 3ds Max will automatically shift the handle to a custom handle, allowing you to move it. The following table lists the icons for the tangency tools.

Icon Name Function
i0824.tif Set Tangents to Auto This flyout icon boasts three tools for controlling Auto tangents. In the flyout, the top icon sets both handles to Auto, the middle icon sets the In tangent, and the bottom icon sets the Out tangent to Auto.
i0825.tif Set Tangents to Custom Custom tangents allow you to move the handles to form your own curvature. If you hold the Shift key as you drag a tangent handle, it will break continuity with the other handle, allowing you to have a different In tangency than Out tangency.
i0826.tif Set Tangents to Fast Sets the tangent to accelerate into or out of a keyframe quickly, or both.
i0827.tif Set Tangents to Slow Sets the tangent to go slowly into or out of the keyframe, or both.
i0828.tif Set Tangents to Step Sets the tangent to “jump” from one value to the next in a single frame. The animation will be frozen until the next keyframe, when it will jerk to that position or value.
i0829.tif Set Tangents to Linear Sets the tangency to a straight linear progression into or out of the keyframe, or both.
i0830.tif Set Tangents to Smooth Attempts to keep the curve smooth across all values to achieve a more realistic motion in many cases.

Curve Toolbar

The Curve tools act on the animation curves themselves, allowing you to easily make changes to an animated track. You will run into some of these tools as you become more experienced with Max. Don’t worry about memorizing all these functions.

Icon Name Function
i0831.tif Lock Selection Locks the current selection so you don’t accidentally select something else.
i0832.tif Snap Frames Snaps keys to frames when you move them. When off, you can move keys to sub-frames (i.e., in-between frames).
i0833.tif Parameter Curve Out-of-Range Types Allows you to set the behavior of your animation before and beyond the keyframed range.
i0834.tif Show Keyable Icons Toggles an icon to tell you whether a track is keyable or not. Red is keyable; black is not.
i0835.tif Show All Tangents Toggles the display of tangent handles on all curves in the graph.
i0836.tif Show Tangents Toggles the display of tangent handles on individual curves.
i0837.tif Lock Tangents Locks a selection of tangent handles so you can adjust them all at once. When off, however, you have access to only one tangent handle at a time.

Biped Toolbar

These Curve Editor Biped tools make the process of using the Curve Editor for biped animation streamlined. Biped tools will be covered in the next chapter. The following table lists the icons and their names for your reference. The functions are obvious based on the tool names. The Biped toolbar is visible only if you have a biped in your scene.

Icon Name
i0838.tif Show Biped Position Curves
i0839.tif Show Biped Rotation Curves
i0840.tif Show Biped X Curves
i0841.tif Show Biped Y Curves
i0842.tif Show Biped Z Curves

Navigation Toolbar

These tools are for Track View navigation. Tools such as Pan, Zoom, and Zoom Region work the same as in the Viewport Navigation tools. Some of the tools are designed specifically for the Track View. A few often-used icons are listed in the following table:

Icon Name Function
i0843.tif Pan Use this tool to drag the key window. You can also use the middle mouse button.
i0844.tif Zoom Horizontal Extents flyout Adjusts the display so that the entire active time segment is shown.
i0845.tif Zoom Value Extents flyout Adjusts the display so that the full heights of the curves are visible.
i0846.tif Zoom Zooms both time and value proportionally together.
i0847.tif Zoom Region Lets you drag a region to scale the display to fit.

Anticipation and Momentum in Knife Throwing

This exercise will give you more experience animating in 3ds Max. In it, you’ll animate a knife being thrown at a target. You will edit more in the Curve Editor (yeah!) and be introduced to the concepts of anticipation, momentum, and secondary movement.

In preparation, download the Knife project from this book’s companion web page to your hard drive. Set your 3ds Max project folder by choosing Application menu ⇒ Manage ⇒ Set Project Folder and selecting the Knife project that you downloaded.

Blocking Out the Animation

To begin this exercise, open the Animation_Knife_00.max file in the Knife project and follow along here:

Figure 8-77: Move the knife to the target at frame 30.

f0877.tif

1. Move the Time Slider to frame 30 and activate the Auto Key button.

2. Move the knife to the target object, as shown in Figure 8-77.

3. Move the Time Slider to frame 15, where the knife is halfway between its start and the target, and move the knife slightly up on the Z-axis so that the knife moves with a slight arc (Figure 8-78).

Figure 8-78: Move the knife up slightly at frame 15.

f0878.tif

4. For now, change the frame range in the Time Slider so you’re working between frame 0 and frame 30. Click the Time Configuration button (i0848.tif) at the bottom of the UI next to the navigation controls. Figure 8-79 shows the Time Configuration dialog box. In the Animation section, change the End Time to 30 from 100 and click OK. The Time Slider will reflect this change immediately.

Figure 8-79: Change the frame range in the Time Configuration dialog box.

f0879.tif

5. Play your animation, and you should see the knife move with a slight ease-in and ease-out toward the target, with a slight arc up in the middle. You want the position of the knife to start at frame 10, so open the Curve Editor and scroll down in the Controller window until you see the X, Y, Z Position tracks for the knife. Hold the Ctrl key and select all three tracks to display their curves (Figure 8-80).

6. Drag a selection marquee around the three keys at frame 0. In the Keys toolbar, select and hold the Move Keys tool (i0815.tif) to access the flyout icons, and select the Move Keys Horizontal tool in the flyout (i0816.tif). Use this tool to move the keys to frame 10 (Figure 8-81).

7. This will compact the curve, as shown previously, so you will need to move the keys at frame 15 (Figure 8-81) to the new middle, frame 20 (Figure 8-82).

That’s it for the gross animation (or blocking) of the shot. Did you have fun?

Figure 8-80: The initial Curve Editor for the knife

f0880.tif

Figure 8-81: Keys from frame 0 moved to frame 10. Select the keys at frame 15 for the next step.

f0881.tif

Figure 8-82: Move the keys to the new middle.

f0882.tif

Trajectories

Figure 8-83: Turning on Trajectories for the knife

f0883.tif

Figure 8-84: The curve shows the trajectory for the knife’s motion.

f0884.tif

When it comes to animation, it is very helpful to be able to see the path your object is taking over time. These paths are known as trajectories in 3ds Max 2011. The easiest way to see the trajectories is to select the knife object, go to the Motion panel, and click Trajectories, as shown in Figure 8-83. Your viewports will display a red curve to show you the path of the knife’s motion as it arcs toward the target, as shown in Figure 8-84.

The large hollow square points on the trajectory curve represent the keyframes set on the knife so far. Let’s adjust the height of the arc using the trajectory curve. Turn on the Sub-Object button at the top of the Motion panel (Figure 8-85).

Figure 8-85: Choose the Sub-Object level.

f0885.tif

Keys is your only sub-object choice in the pull-down menu to the right of the button. Select the middle keyframe and move it up or down to suit your tastes, as shown in Figure 8-86. Once you settle on a nice arc for the path of the knife, turn off the Trajectories mode by clicking the Parameters button in the Motion panel.

As you can imagine, the Trajectories options can be useful in many situations. It not only gives you a view of your object’s path, but it also allows you to edit that path easily and in a visual context, which can be very important.

Figure 8-86: Raise the arc of the knife by altering its trajectory.

f0886.tif

Adding Rotation

The next step is to add a bit of rotation to the knife. As an animator, you need to research and gather as much information about your subject matter as you can. Throwing knives is usually a bad idea, but you can throw something else—ideally something that is shaped and weighted like a knife—at a target (the inanimate kind) to see how to animate your knife. Almost invariably, you’ll find that the object will have to rotate once or twice before it hits its target. To add rotation to your CG knife, follow these steps:

1. Move to frame 30, and press the E key for the Select and Rotate tool. Auto Key should still be active. In the Perspective viewport, Rotate on the Y-axis 443 degrees, as shown in Figure 8-87.

2. Scroll down to find the X, Y, and Z Rotation tracks, and select them. Select the keys at frame 0 then use the Move Keys Horizontal tool to shift the keyframes to frame 10. Press N to deactivate the Auto Key. Figure 8-88 shows the Curve Editor graph for the knife.

3. Play the animation, and you will see that the knife’s position and rotation eases in and eases out. A real knife would not ease its rotations or movement. Its speed would be roughly consistent throughout the animation.

Figure 8-87: Rotate on Y.

f0887.tif

Figure 8-88: Move the first Rotation keyframes to frame 10.

f0888.tif

4. Go back to the Curve Editor, change Move Keys Horizontal back to Move Keys. Then select the X Position track, select all the keyframes, and switch the tangent to Linear. Now select the Z Position track; you’ll need to finesse this one a bit more than the X Position track. You are going to use the handles on the tangents that appear when you select a key. These handles can be adjusted; just center your cursor over the end and click and drag using the Move tool. Figure 8-89 illustrates how you want the Z Position animation curve to look. This will give the trajectory a nice arc and a good rate of travel.

Figure 8-89: Adjust the curve for the knife’s arc through the air.

f0889.tif

5. Now it is time to edit the Rotation keys. In the Curve Editor scroll to find the X, Y, and Z Rotation tracks. The first thing you can do is add a bit of drama to the knife to make the action more exciting. To this end, you can say that the rotation on the knife is too slow. Select the X Rotation track and select its key at frame 30. In the Key Stats, change the value to –52. The higher the value, the faster the knife will rotate. This will add one full revolution to the animation and some more excitement to the action.

6. Adjust the tangent handles to resemble the curve shown in Figure 8-90. The knife will speed up just a little bit as it leaves the first rotation keyframe. The speed will be even as it goes into the last keyframe.

Figure 8-90: Match your curve to this one.

f0890.tif

With just a little bit of fast rotation as the knife leaves frame 10, you give the animation more spice. A little change in the curve can make a big difference in an animation—every little bit counts. The knife should now have a slightly weightier look than before, when it rotated with an ease-in and ease-out.

Adding Anticipation

Instead of making the knife just fly through the air toward the target, you should animate it to move back first to create anticipation, as if an invisible hand holding the knife pulled back just before throwing it to get more strength in the throw. This anticipation, although it’s a small detail, can add a level of nuance to the animation that enhances the total effect. Follow these steps:

1. Move the Time Slider to frame 0. Go to the Curve Editor, scroll the Controller window, and select the X Rotation track for the knife. In the Curve Editor toolbar, click the Add Keys button (i0812.tif), bring your cursor to frame 0 of the curve, and click to create a keyframe. This creates a key at frame 0 with the same parameters as the next key, as shown in Figure 8-91.

2. Select the Move Keys tool and select the key at frame 10. In the Key Stats type-in, change the value of that key to 240. If you play back the animation, it will look weird. The knife will cock back really fast and spin a bit. This is due to the big hump between frames 0 and 10.

Figure 8-91: Adding a key to the beginning to create anticipation for the knife throw

f0891.tif

3. Keep the tangent at frame 0 set to the default, but change the tangent on the key at frame 10 to Linear. Play back the animation. You’ll have a slight bit of anticipation, but the spice will be lost and the knife will look less active and too mechanical.

4. To regain the weight you had in the knife, press Ctrl+Z to undo your change to the tangency on frame 10 and set it back to what you had (just like Figure 8-91). You may have to undo more than once. Now, select the Move Keys Vertical tool and select the In tangent for keyframe 0. This is the tangent handle on the left of the key, as shown in Figure 8-92.

Figure 8-92: The In tangent is the one on the left.

f0892.tif

It’s very common to try something in the course of your work, and rely on Undo to get back to the starting point. You can sometimes expect to use Undo several times when you find yourself at a dead end.

5. Press Shift and drag the tangent handle down to create a curve that is similar to the one shown in Figure 8-93. By pressing Shift as you dragged the tangent handle, you broke the continuity between the In and Out handles, so that only the In handle was affected. Play back the animation. It should look much better now.

Remember, the smallest tweaks in the Curve Editor can have a huge positive or negative impact on your animation.

Figure 8-93: To create a believable anticipation for the knife throw, set your curve to resemble this one.

f0893.tif

Follow-Through

The knife needs more weight. A great way to show that in animation is by adding follow-through. The follow-through for the knife would be having the knife sink into the target a little bit and push back the target as it transfers momentum to the target. For more on momentum, see the “Momentum” sidebar later in this chapter.

Knife Follow-Through

To add follow-through to your animation, follow these steps:

1. You want to sink the knife into the target after it hits. Select the Time Configuration button (shown in Figure 8-94), and change the End Time to 45 to add 10 frames to your frame range. Click OK. This will not affect the animation; it will merely append 10 frames to the current frame range.

Figure 8-94: Time Configuration button

f0894.tif

2. Select the knife and go to frame 30, where it hits the target. In the Curve Editor, select the X Position track of the knife. Add a keyframe with the Add Keys tool at frame 35.

3. Note the value of the key in the type-in boxes at the bottom of the Curve Editor (not the type-in boxes at the bottom of the main UI). In this case, the value in this scene is about –231. You will want to set the value for this key at frame 35 to about –224 to sink it farther into the target. If your values are different, adjust accordingly so you don’t add too much movement. Also make sure the movement flows into the target and not back out of the target as if the knife were bouncing out.

4. Keep the tangent for this new key set to Auto. With these relative values, scrub the animation between frames 30 and 35. You should see the knife’s slight move into the target. The end of your curve should look like the curve in Figure 8-95.

5. You still need to add a little bit of follow-through to the rotation of the knife to make it sink into the target better. In the Curve Editor, select the X Rotation track to display its curve. Add a key to the curve at frame 35. The value of the key at frame 30 should already be about –652. Set the value of the keyframe at frame 35 to be about –655 (Figure 8-96). Keep the tangent set at Auto.

Figure 8-95: Your animation should end like this.

f0895.tif

Figure 8-96: Set –655 at frame 35.

f0896.tif

Be careful about how much the knife sinks into the target. Although it is important to show the weight of the knife, it is also important to show the weight of the target; you do not want the target to look too soft. Make sure your key values at frame 35 for the X Position and X Rotation are not too much.

Transferring Momentum to the Target

To make the momentum work even better for the knife animation, you will have to push back the target as the knife hits it. The trouble is, if you animate the target moving back, the knife will float in the air. You have to animate the knife with the target. However, animating them separately in the hopes they will match up will frustrate you and will more than likely look bad.

If you think that hierarchy has to be involved here, you are absolutely right. Basically, the knife will have to be linked to the target so that when the target is animated, the knife will follow precisely, because it is stuck in the target.

This won’t mess up the animation of the knife. Because the knife will be the child in the hierarchy and can have its own animation separate from the target, you can link it after you are finished with the knife animation. Just follow these steps:

1. Go to frame 30, where the knife impacts. Choose the Select and Link tool. Select the knife and drag it to the target as shown in Figure 8-97. Nothing should change until you animate the target object.

Figure 8-97: Link the knife to the target, and then rotate the target back slightly.

f0897.tif

2. Move the Time Slider to frame 34 and press the N key to activate the Auto Key tool. With the Select and Rotate tool, select the target object and rotate it back about 5 degrees, as shown in the second image in Figure 8-97. The pivot of the target has already been placed properly, at the bottom back edge.

3. Go to the Curve Editor, scroll to find the Y Rotation track for the target object, select the keyframe at frame 0, and move it to frame 30. Then hold the Shift key, and click and drag the keyframe (which will make a copy of it) to frame 37. Your curve should resemble the curve in Figure 8-98.

Figure 8-98: The target will rock back and forth on impact.

f0898.tif

4. Change the tangent for the key at frame 30 to Fast and leave the other key tangents alone.

5. Add a little wobble to the target to make the animation even more interesting. This can be done very easily in the Curve Editor. Use Add Keys to add keys at frames 40 and 44. Using the Move Keys Vertical tool, give the key at frame 40 a value of about 1.7. Your curve should resemble the one in Figure 8-99.

Figure 8-99: The target animation curve

f0899.tif

6. Finally, add a little slide to the target. Using the Select and Move tool, move the Time Slider to frame 37, and move the target just a bit along the X-axis. Go to the Curve Editor, scroll to the X position of the target object, select the keyframe at frame 0, and move it to frame 30 so the move starts when the knife hits the target. Change the tangent for frame 30 to Fast and leave the other tangent at Auto.

Done! Play back your animation. Experiment and change some of the final timings of the target’s reaction to the impact, as well as some of the values, to see how small changes can make big differences in the way the weights of the knife and target look to the viewer.

Momentum

Understanding what momentum is and how it works is pretty important for an animator. When an object is in motion, it has momentum. The amount of momentum is calculated by multiplying the mass of the object by its velocity. The heavier something is, or the faster it is moving, the more momentum it has and the bigger the bruise it will leave if it hits you.

That’s why a tiny bullet can cause such a great impact on a can of stew, for example. Its sheer speed greatly increases its momentum. Likewise, a slow-moving dump truck can bash in your car, relying on its sheer mass for its tremendous momentum.

Basically, when one moving object meets another object that is moving or not, momentum is transferred between them. That means when something hits an object, that target is somehow moved if there is sufficient momentum transferred to it.

It follows that the more mass an object has, the more momentum will transfer to the target. Also, the more velocity an object has, the more momentum will be transferred to the target on collision. You will be able to show the mass of an object in animation by showing how much momentum it transfers when it impacts another object. This could be as simple a as knife hitting a target and moving it back, as you animated in the exercise in this chapter, or as complicated as a heavyset man walking down the street. In the latter case, because the pavement can’t give way underneath the man, the momentum that is transferred is reflected back to the man and absorbed by his body. That makes his body bend and flex and his big belly jiggle up and down with each step.

Impact is a perfect opportunity for an animator to show his subject’s mass in motion, and it is always intrinsic in good animation.

You can see a sample render of the scene in the knife_animation.mov QuickTime file in the RenderOutput folder of the Knife project on the companion web page (or copied onto your hard drive). You can also download the Animation_Knife_01.max scene file from the Scenes folder of the Knife project to check your work.

Introducing Maya 2011 (Wiley, 2010) includes an ax-throwing exercise that teaches the same kinds of animation concepts as the knife-throwing exercise in this chapter. Check it out if you are curious about how 3ds Max and Maya animate similar scenes.

Summary

In this, the first of two chapters on animation, you learned the basics of creating and editing animation. You learned about hierarchies and how to link objects together to create a hierarchy useful for our mobile animation as well as how pivot points are used. You also learned how to create animation using the Auto Key function.

You learned how to fix hierarchy problems in animation and how to use dummy objects to help you animate properly. You bounced a ball to learn timing issues and how to edit animation curves through the Curve Editor. You then learned the ins and outs of the Track View–Curve Editor before moving on to a thrown knife to learn about trajectories and the concepts behind using secondary movement to help give your animation weight.

Animation can be a lot of fun, but it is also tedious and sometimes aggravating. A lot of time, patience, and practice are required to become good at animation. It all boils down to how the animation makes you think. Is there enough weight to the subjects in the animation? Do the movements make sense? How does nuance enhance the animation? These are all questions you will begin to discover for yourself. This chapter merely introduced you to how to make things move in 3ds Max. It gave you some basic animation techniques to help you develop your eye for motion. Don’t stop here. Go back into the chapter and redo some of the exercises. Try different variations on the same themes. Keep working.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset