Introducing Maya 6: 3D for Beginners | 6 | WebReference

Introducing Maya 6: 3D for Beginners | 6

Introducing Maya 6: 3D for Beginners

GROUPING THE MOON WITH EARTH

To create the animation of Earth's orbit of the sun, you need to make sure that the moon will also follow Earth around the sun. So, instead of just selecting Earth and grouping it to itself as you've done for the other two planets, you need to include Moon_Orbit. Follow these steps:

1. Select Earth and then Shift+click the group Moon_Orbit while in hierarchy mode to make sure you get the topmost node of the moon, and then choose Edit . Group. Name this Earth_Orbit. Remember, when you simply select either Earth or the moon in object mode, the Earth_Orbit node is not selected. If you select Earth and then Shift+click the moon, you do select both objects, but you will still not select Earth_Orbit, the group that contains both these objects and has its pivot point at the center of the sun. So make sure you select the right group.

Make sure you use Hierarchy Mode ( ) when you click the moon object to select Moon_Orbit and not just the moon sphere. Otherwise, you will lose the animation of the moon orbiting Earth.

2. Set a keyframe for Earth_Orbit's Rotate Y attribute at frame 1 by highlighting Rotate Y in the Channel Box and pressing S for the Set Key command. This assumes you have changed the defaults in in Animate > Set Key q as discussed earlier.

3. Go to frame 240, spin Earth and the moon around the sun a few times, and set a keyframe there as well.

Now the first three planets are going around themselves and around the sun, with a moon in there too. If you haven't been saving your work, save it now. Just don't save over the un-animated version from before.

CREATING THE OTHER PLANETS' MOONS

Repeat this animation procedure for the remaining planets and moons, but leave out Pluto for now.

If you find that one of your moons is left behind by its planet or that it's no longer rotating around the planet, you most likely made an error when grouping the moon and planet. Undo until you're at the point right before you grouped them, and try again. If that still doesn't work, start over from the earlier version of the file you saved just before you started animating it.

AUTO KEYFRAME

You can also use the Auto Keyframe feature when animating the planets and moons. Auto Keyframe automatically sets a keyframe for any attribute that changes from a previously set keyframe. For example, an initial keyframe for an attribute such as Y-Axis Rotation needs to be set at some point in the animation. The next time the Y-Axis Rotation is changed, Maya will set a keyframe at the current frame automatically.

To turn on Auto Keyframe, click the Auto Keyframe icon ( ), which is to the right of the Range Slider. When the icon is red, Auto Keyframe is active. To use Auto Keyframe to animate Mars' moon orbiting Mars, follow these steps:

1. Turn on Auto Keyframe.

2. Start at frame 1. Select Mars' moon and set a keyframe for its Y rotation by highlighting Rotate Y in the Channel Box and pressing S.

3. Got to frame 240. Rotate the moon around Mars several times. Maya will automatically set a frame for Y rotation at frame 240. Save your file.

Using the Outliner

Now, let's look at how to use the Outliner to illustrate the hierarchies for the planets and moons. When all is good and proper, the Outliner should look like Figure 3.14. Choose Window > Outliner and take a peek at what you have. If you haven't yet named everything properly, such as the moons, take this opportunity to do so.

Let's take a look at the planet Mars and its layout in the Outliner to better understand the hierarchy for all the planets. All the other planets should be laid out exactly like Mars (except for the planets that have either one or no moons).

At the bottom of the hierarchy are Mars' two moons, mars_moon and mars_moon2. Each of those moons is spinning on its own pivot point. You then grouped each moon to itself, creating the mars_moon_orbit and mars_moon2_orbit nodes, and you placed their pivot points at the center of Mars to animate their orbits of Mars.

Mars is spinning on its own pivot point, but it needed another pivot point to be able to orbit the sun. Since you needed to make the moons go with it around the sun, you selected Mars, mars_moon_orbit, and mars_moon2_orbit (the top nodes of the moons that circle the planet Mars) and grouped them all together, placing that pivot point at the center of the sun. This node you called Mars_Orbit. This is the parent node since it is the topmost node for this group. Where this parent node goes, so follow the children nodes that are grouped under it.

Hierarchy such as this is a cornerstone of Maya animation. It is imperative to be comfortable with how it works and how to work with it.

Figure 3.14 The Outliner view of the planet hierarchies

Correcting Hierarchy Problems Using the Outliner

One of the most common problems you will run into with this project is a planet rotating around the sun without its moon. The following steps will force you to make this error with the planet Pluto, to illustrate how to fix it using the Outliner—as opposed to undoing and redoing it as suggested earlier.

Go to Pluto, start the same animation procedure as outlined earlier, and then follow these steps:

1. Create Pluto's own rotation by spinning it around itself.

2. Do the same for its moon's rotation.

3. Group the moon to itself and grid-snap the pivot point at the center of Pluto to create the moon's orbit of Pluto.

Once Pluto's moon (pluto_moon) is orbiting Pluto, you're ready to group the moon's orbit and Pluto together to create an orbit of the sun for them both.

4. Here is where you make your mistake. In object mode, select the sphere for Pluto's moon, and select the sphere for Pluto. Your error is that you are remaining in object mode instead of switching to hierarchy mode.

Figure 3.15 Pluto's incorrect hierarchy

5. Choose Edit > Group to group them together, and call that new node Pluto_Orbit like the others.

6. Animate Pluto_Orbit rotating around the sun.

7. Playback the animation.

Notice that the moon is no longer orbiting the planet. This is because you didn't include pluto_moon_orbit in your group Pluto_Orbit. The animation of the moon going around Pluto is stored in that node, and since it is no longer attached to your Pluto_Orbit, there's no moon orbit of Pluto.

Figure 3.15 shows the hierarchy of Pluto and how it's different from the other planets (with Earth showing as an example). The moon's orbit node has been left out of the

group.

Using the Outliner, you can easily fix this problem. You will place the pluto_moon_orbit node under the Pluto_Orbit node. Go to frame 1 of the animation, grab the pluto_moon_orbit node in the Outliner, and MMB drag it to the Pluto_Orbit node so that it has a black horizontal line above and below it to show a connection, as in Figure 3.16.

You have just grouped pluto_moon_orbit under Pluto_Orbit, a practice known as parenting. Now you need to parent pluto_moon under pluto_moon_orbit as well. MMB drag pluto_moon onto pluto_moon_orbit. When you playback the animation, you will see that the moon is rotating around the planet as Pluto and the moon both orbit the sun. Now the layout in the Outliner for Pluto is similar to the other properly working planets.

Figure 3.16 Regrouping objects in the Outliner

The file Planets_v3.mb in the Scenes folder of the Solar_System project on the CD will give you an idea how this project should now look. The first five planet systems are grouped and animated as reference, leaving the final four for you to finish.

GROUPING TERMINOLOGY

Grouping terminology can be confusing. Grouping Node A under Node B makes Node A a child of Node B. Node B is now the parent of Node A. Furthermore, any transformation, or movement, applied to the parent Node B will be inherited by the child Node A.

When you group Node A and Node B, both nodes become siblings under a newly created parent node, Node C. This new node is created just to be the parent of Nodes A and B and is otherwise known as a null node. To group objects, select them and choose Edit > Group.

Parenting nodes together places the first selected node under the second selected node. For example, if you select Node A, Shift+select Node B, and then choose Edit > Parent, Node A will group under Node B and become its child. This is the same procedure as MM dragging Node B to Node A in the Outliner as you did with Pluto's moon and Pluto itself.

You can add objects to a group by MMB dragging their listing onto the desired parent node in the Outliner. You can also remove objects from a group by MMB dragging them out of the parent node to a different place in the Outliner.

Summary

The planet animation you created is based on a system of layering simple actions on top of each other to achieve a more elaborate result. If you work slowly and in segments, animation is more straightforward to produce and generally is of a higher quality. Much of your time in actual animation—as opposed to setup or modeling—will be spent adjusting the small things. These small things give the scene life and character. You will find that finishing 85 percent of a scene will take about 15 percent of the time. The remaining 85 percent of the time goes into perfecting the final 15 percent of the scene.

Created: March 27, 2003
Revised: November 1, 2004

URL: http://webreference.com/graphics/maya_6/1