Animating Objects


Many different objects in Max can be animated, including geometric objects, cameras, lights, and materials. In this section, we look at several types of objects and parameters that can be animated.

Animating cameras

You can animate cameras using the standard transform buttons found on the main toolbar. When animating a camera that actually moves in the scene, using a Free camera is best. A Target camera can be pointed by moving its target, but you risk its being flipped over if the target is ever directly above the camera. If you want to use a Target camera, attach both the camera and its target to a Dummy object using the Link button and move the Dummy object.

Two useful constraints when animating cameras are the Path constraint and the Look At constraint. You can find both of these in the Animation image from book Constraints menu. The Path constraint can make a camera follow a spline path, and the Look At constraint can direct the focus of a camera to follow an object as the camera or the object moves through the scene.

CROSS-REF 

For more on constraints, including these two, see Chapter 32, "Animating with Constraints and Controllers."

Tutorial: Animating darts hitting a dartboard

As a simple example of animating objects using the Auto Key button, we animate several darts hitting a dartboard.

To animate darts hitting a dartboard, follow these steps:

  1. Open the image from book Dart and dartboard.max file from the Chap 29 directory on the DVD.

    This file includes a dart and dartboard objects created by Zygote Media.

  2. Click the Auto Key button (or press the N key) to enable animation mode. Drag the Time Slider to frame 25, and click the Select and Move button on the main toolbar (or press the W key).

  3. Select the first dart in the Left viewport, and drag it to the left until its tip just touches the dartboard.

    This step creates a key in the Track Bar for frames 0 and 25.

  4. Click the Select and Rotate button on the main toolbar, set the reference coordinate system to Local, and constrain the rotation to the Y-axis. Then drag the selected dart in the Front viewport to rotate it about its local Y-axis.

    This step also sets a key in the Track Bar.

  5. Select the second dart, and click the Select and Move button again. Right-click the Time Slider to make the Create Key dialog box appear. Make sure that the check boxes for Position and Rotation are selected, and click OK.

    This step creates a key that keeps the second dart from moving before it's ready.

  6. With the second dart still selected, drag the Time Slider to frame 50 and move the dart to the dartboard as shown in Step 3. Then repeat Step 4 to set the rotation key for the second dart.

  7. Repeat Steps 3, 4, and 5 for the last two darts.

  8. Click the Auto Key button (or press the N key) again to disable animation mode, maximize the Perspective viewport, and click the Play Animation button to see the animation. Figure 29.13 shows the darts as they're flying toward the dartboard.

image from book
Figure 29.13: One frame of the dart animation

Animating lights

The process for animating lights includes many of the same techniques as that for animating cameras. For moving lights, use a Free Spot light or attach a Target Spot light to a Dummy object. You can also use the Look At and Path controllers with lights.

CROSS-REF 

If you need to animate the Sun at different times in the day, use the Daylight or Sunlight systems, which are discussed in Chapter 27, "Using Lights and Basic Lighting Techniques."

To flash lights on and off, enable and disable the On parameter at different frames and assign a Step Tangent. To dim lights, just alter the Multiplier value over several frames.

Animating materials

Materials can be animated if their properties are altered while the Auto Key button is active. Max interpolates between the values as the animation progresses. The material must be consistent for the entire animation: You cannot change materials at different keys; you can only alter the existing materials parameters.

If you want to change materials as the animation progresses, you can use a material that combines multiple materials, such as the Blend material. This material includes a Mix Amount value that can change at different keyframes. The next tutorial shows how to use the Blend material in this manner.

Several maps include a Phase value, including all maps that have a Noise rollout. This value provides the means to animate the map. For example, using a Noise map and changing the Phase value over many keys animates the noise effect.

A useful way to view animated materials is to click the Make Preview button (the sixth button from the top) to open the Create Material Preview dialog box, shown in Figure 29.14. Select the Active Time Segment option, and click OK. The material renders every frame and automatically opens and plays the material preview.

image from book
Figure 29.14: The Create Material Preview dialog box can render the entire range of frames or a select number of frames.

Tutorial: Dimming lights

Occasionally, you'll want to change materials in a scene to gradually alter it in some way such as dimming a light. You can easily accomplish this task with the Blend material.

To create a light that dims with time, follow these steps:

  1. Open the image from book Dimming light.max file from the Chap 29 directory on the DVD.

    This file contains a simple lamp object with a sphere to represent a lightbulb.

  2. Open the Material Editor by pressing the M key, and select the first sample slot. Then click the Type button, and select the Blend material from the Material/Map Browser. Select the Discard Old Material option in the Replace Material dialog box that appears. Give the material the name Dimming Light.

    Note 

    When using composite materials, a dialog box appears asking whether you want to discard the old material or keep it as a submaterial. If you choose to keep it, the current material in the sample slot becomes one of the maps for the composite material.

  3. Click the Material 1 button in the Blend Basic Parameters rollout, and name the material Light On. Set the Diffuse color in the Blinn Basic Parameters rollout to yellow and the Self-Illumination to yellow. Then click the Go Forward to Sibling button.

    Note 

    Composite materials such as Blend include several submaterials. When one of these submateri-als is selected, you can move quickly to the other submaterials by clicking the Go Forward to Sibling button. To access the root material, click the Go to Parent button.

  4. Name the second material Light Off, and select a gray Diffuse color. Then click the Go to Parent button to return to the Blend material.

  5. With the Time Slider at frame 0, click the Auto Key button (or press the N key). Then drag the Time Slider to frame 100, and change the Mix Amount to 100. Click the Auto Key button again to deactivate it. The material changes gradually from the "Light On" material to the "Light Off" material. By dragging the Time Slider, you can see the material in the sample slot change.

  6. Select the lightbulb object, and click the Assign Material to Selection button to assign the material to the bulb object.

Figure 29.15 shows a simple lamp object with a dimming sphere in its center. The actual dimming effect isn't visible in the viewport-only when the image is rendered.

image from book
Figure 29.15: This lamp object dims as the animation proceeds.

Creating Image File Lists

Anywhere you can load a bitmap map, you can also load an animation file such as a Microsoft Video (AVI) or a QuickTime (MOV) file. Another way to create animated material is with Image File Lists, which is a text file that lists each separate image file contained in an animation. Max supports two different image file formats-Autodesk ME Image Sequence File (IMSQ) and 3ds Max Image File List (IFL) files.

IMSQ and IFL files are text files that list which images should appear and for which frames. You save them with the .IMSQ or .IFL extension and load them using the Bitmap map. Image file lists can be created during the render process by selecting the Put Image File List in Output Path option in the Common Parameter rollout of the Render Scene dialog box. There is also a Create Now button to create an image file list at any time.

To manually create an IMSQ or IFL file, open a text editor and type the name of the image followed by the number of frames for which it should appear. Be sure to include a space between the name and the number of frames. The images are displayed in the order they are listed and repeated until all frames have been displayed. Once applied, the image file list is visible in the sample slot if you drag the Time slider, or you can create a material preview.

Note 

You can also use the * and? wildcard characters within an IFL file. For example, flyby* includes any image file that begins with "flyby," and flyby? includes any image file that begins with "flyby" and has one additional character.

Generating IFL files with the IFL Manager Utility

If you don't want to create text files by yourself, you can use the IFL Manager Utility to generate IFL files for you. To use this utility, open the Utilities panel and click the More button. Then select the IFL Manager Utility, and click OK.

In the IFL Manager rollout, shown in Figure 29.16, the Select button opens a File dialog box where you can select a sequential list of images to include in an IFL file. After you select a list of images, you can specify the Start and End images. You can cause the images to be displayed in reverse by placing a greater number in the Start field than is in the End field. The Every Nth field can specify to use every Nth image. You use the Multiplier field to specify in how many frames each image should appear.

image from book
Figure 29.16: IFL Manager Utility can help to create IFL files.

The Create button opens a File dialog box where you can save the IFL file. The Edit button opens an IFL text file in the system's default text editor for editing.

Tutorial: What's on TV?

Animated files such as AVI and MOV can be opened and mapped to an object to animate the texture, but you can also use IFL files.

To create an IFL file that will be mapped on the front of a television model, follow these steps:

  1. Open the Windows standard Notepad text editor, and type the following:

          ; these frames will be positioned on a television screen.      static.tif 20      Exploding planet - frame 10.tif 2      Exploding planet - frame 15.tif 2      Exploding planet - frame 20.tif 2      Exploding planet - frame 25.tif 2      Exploding planet - frame 30.tif 2      Exploding planet - frame 35.tif 2      Exploding planet - frame 40.tif 2      Exploding planet - frame 45.tif 2      Exploding planet - frame 50.tif 2      Exploding planet - frame 55.tif 2      static.tif 60 

    Note 

    The first line of text is referred to as a comment line. You enter comments into the IFL file by starting the line with a semicolon (;) character.

  2. Save the file as image from book tv.ifl. Make sure that your text editor doesn't add the extension .TXT on the end of the file.

    You can check your file with the one I created, which you can find in the Chap 29 directory on the DVD.

    Note 

    The IFL file as described earlier looks for the image files in the same directory as the IFL file. Make sure that the images are included in this directory.

  3. Open the Television-IFL File.max file from the Chap 29 directory on the DVD.

    This file includes a television model created by Zygote Media.

  4. Select the television front screen object, open the Material Editor, and select the first sample slot. Name the material Television Screen. Click the map button to the right of the Diffuse color swatch. Double-click the Bitmap map. In the File dialog box, locate the image from book tv.ifl file and click OK. Then click the Assign Material to Selection button to apply the material to the screen.

    Tip 

    To see the map in the viewport, click the Show Map in Viewport button. This button makes the frames of the IFL file visible in the viewport.

  5. Because the screen object is a mesh object, you need to use the UVW Map modifier to create some mapping coordinates for the map. Open the Modify panel, and click the UVW Map button. Set the mapping option to Planar. Then click the Sub-Object button, and transform the planar gizmo until it covers the screen.

  6. Click the Play button (/) to see the final animation.

Figure 29.17 shows one rendered frame of the television with the IFL file applied.

image from book
Figure 29.17: You can use IFL files to animate materials via a list of images.




3ds Max 9 Bible
3ds Max 9 Bible
ISBN: 0470100893
EAN: 2147483647
Year: 2007
Pages: 383

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net