In this chapter, you’ll start using the Autodesk® Maya® software and get your groove on. This will be a quick primer on the Maya interface so you experience tasks right away. The next chapter will show you more details and provide additional explanations and a reference of how the entire Maya interface functions as you work on another project.
In this chapter you will follow an exercise for creating a solar system and learn the mechanics of animating orbits. With this exercise, you’ll create simple objects, set keyframes, and stack your animation to get planets and moons to orbit each other and the Sun. This will expose you to object creation, simple modeling, object components, pivot-point placement, grouping and hierarchies, basic keyframing, and timing.
Fire up your computer, and let’s get going. This section will introduce you to getting around the Maya user interface (UI).
The overall goal of this chapter is to expose you to Maya UI basics as well as important scene creation and editing tools. You’ll find more details on the interface in Chapter 3, “The Autodesk Maya 2015 Interface.”
Let’s get to the basics of how Maya is laid out (see Figure 2-1). Running across the top of the screen, right under the application title bar, are the UI elements: the main menu bar, the Status line, and the Shelf. On Mac OS X, note that the main menu bar runs across the top of the screen, above the application title bar.
Figure 2-1 shows the major parts of the UI. In the middle of the interface is the workspace, which is host to your panels (or Scene windows) and their menu options (known as views or viewports in some other 3D packages). This is where most of your focus will be.
Click inside the large Perspective view panel (named persp) with the mouse to activate the panel, highlighting its border slightly. Press the spacebar to display a four-panel layout, which gives you top, front, and side views, as well as the perspective view. Press the spacebar in any of the panels to display a large view of that panel.
To the right of the panels is the Attribute Editor/Channel Box/Modeling Toolkit. This is where most of the information (attributes) about a selected object is displayed and edited. Also, this is where you access the Modeling Toolkit suite of polygon tools. Simply click any of the tabs to access these functions. Furthermore, pressing Ctrl+A toggles between the Attribute Editor and the Channel Box.
In short, the Attribute Editor gives you access to all of an object’s attributes, whereas the Channel Box is a quicker display of the most commonly animated attributes of the selected object.
Maya is case sensitive (meaning it distinguishes between lowercase and uppercase letters). The conventions of this book are to always print an uppercase letter to denote which key you must press. So, when I ask you to press the E key, for example, you should simply press the E key on your keyboard (thereby entering a lowercase e). When an uppercase letter is called for, the book tells you to press Shift+E, thereby entering the uppercase letter E into Maya. Also, make sure your Caps Lock key is turned off.
Maya requires the use of a three-button mouse, even on a Mac. The clickable scroll wheel found on most mice can be used as the third button by pressing down to click with the wheel.
In Maya, you press and hold the Alt key on a PC (or the Option key on a Mac) along with the appropriate mouse button to move in the view panel.
Selecting objects in a view panel is as easy as clicking them. As you select an object, its attributes appear in the Attribute Editor or Channel Box on the right. To select multiple objects, simply hold the Shift key as you click objects to add to your current selection. If you press Ctrl+LMB (press the Ctrl key and click) on an active object, you’ll deselect it. To clear all of your current selections, click anywhere in the empty areas of the view panel.
When you select an object and enable one of the transformation tools (tools that allow you to move, rotate, or scale an object), you’ll see a manipulator appear at or around the selected object. Figure 2-2 shows the three distinct and most common manipulators for all objects in Maya (Move, Rotate, and Scale) as well as the Universal Manipulator. You use these manipulators to adjust attributes of the objects visually and in real time.
To activate a transform tool, select an object and then click one of the transform tool icons in the Tool Box, shown in Figure 2-3.
Go ahead and click around the interface some more. Create more primitive objects and tool around a bit. Move around the view panels and see how it feels. Give the tires a good kick.
Enough chatting—let’s jump into the solar system exercise.
This project will familiarize you with the fundamentals of navigating Maya, object creation, hierarchy, and pivots, all of which are important concepts for scene manipulation and animation within Maya. In this exercise, you’ll gain experience with UI elements while setting up a Maya project in which you create and manipulate objects. You will animate a simple simulation of your working solar system, making and adjusting hierarchies for animation and setting keyframes.
Starting with the Sun in the center, the planets in order are Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, and Pluto. (Yes, yes, I know Pluto isn’t classified as a planet anymore.) All these planets orbit the Sun in ellipses, but you’ll give them circular orbits for this exercise. Most planets have a number of moons that orbit them, and a few, including Saturn, have large rings that circle them. For this exercise, we will create only two moons for any planet that has more than two moons, like Jupiter.
The more you run this exercise, the clearer the scene manipulation and hierarchy structure will become to you. Art is a marriage of inspiration, hard work, and practice.
Projects are the way Maya manages a scene’s assets. A file and folder structure keeps your files organized according to projects. You will want to have a new project for this new exercise.
The top level of this organization is the project folder. Within the project folder are numerous file folders that hold your files. When you set your workspace to a project folder (or when you create a new project), Maya will know where to look for elements and folders for that project. The two most important types are the Scenes and Images folders. The Scenes folder stores your scene files, which contain all the information for your scene. The Images folder stores images you’ve rendered from your scene.
To create a new project for this assignment, follow these steps:
The
default location for Windows XP, Vista, and Windows 7 is the current user’s
My Documents folder: My Documents\maya\projects
; for Macs, the
default location is Home (/Users/
<yourname>) in the
Documents/maya/projects/default
folder; and for Windows 8
users it is found under the Documents location under the Start menu. If you
prefer, you can put projects in a folder on a secondary or external hard
drive to keep them separate from your operating system; this allows for
easier backup and is generally a safer environment.
D:\Projects
(Windows) or <Hard Drive
Name>/Projects
(Mac) for the location. Maya will fill
in all the other fields for you with defaults. Click Accept to create the
necessary folders in your specified location. Figure 2-4 shows the completed Project Window in Mac
OS X; except for the drive name, the values are the same on Windows.
After you create projects, you can switch between them by choosing File ⇒ Set Project and selecting the new project. Maya will then use that project’s folders until you switch to or create another project. You may also select a recent project by choosing File ⇒ Recent Projects.
In this project, you’ll first create the Sun, the planets, and their moons; then, you’ll animate their respective orbits and rotations.
The first thing you’ll do is create the Sun and the planets. Follow these steps:
Naming your objects right after creation is a good habit to develop and is particularly important if anyone needs to alter your scene file; proper naming will keep them from getting frustrated when they work on your scene.
Next, you’ll create the primitive spheres for the planets. Leave Interactive Creation off, and follow these steps:
Planet Sphere Sizes | ||
Venus | 0.5 | |
Earth | 0.5 | |
Mars | 0.4 | |
Jupiter | 1.0 | |
Saturn | 0.9 | |
Uranus | 0.7 | |
Neptune | 0.7 | |
Pluto | 0.15 |
These proportions aren’t exactly real, but they will do nicely here. Figure 2-8 shows how your solar system should look now.
Now is the perfect time to start using snaps. Table 2-1 shows some common snap icons. These icons run across the top of the UI just below the main menu bar, as shown here.
Table 2-1: Snap icons
Snap icon | Name | Description |
Snap To Grids | Snaps objects to intersections of the view’s grid | |
Snap To Curves | Snaps objects along a curve | |
Snap To Points | Snaps objects to object points such as CVs or vertices | |
Snap To Projected Center | Snaps an object to the center of another object | |
Snap To View Planes | Snaps objects to view planes |
You use snaps to snap objects into place with precision, by placing them by their pivot points directly onto grid points, onto other object pivots, onto curve points, and so on. Here you’ll reposition all the planets slightly to center them on the nearest grid line intersection:
Now, create the ring for Saturn. To do so, follow these steps:
You need to edit the attributes of the ring to increase the inside radius of the donut shape and create a gap between the planet and the ring.
Now all your planets are complete, and you can move on to the moons.
Save your work, unless you like to live on the edge. Power failures and other
unforeseen circumstances (such as your pet jumping onto your keyboard) may not
happen often, but they do happen. Because you created this as a new project, the
Save File window will direct you to the Scenes folder of that project. Save your
scene as planets in the .mb
(Maya
Binary) format.
The file Planets_v1.mb
in the Scenes folder of the Solar_System project,
available on the book’s web page, shows what the scene should look like at this
point.
For the planets with moons, create a new NURBS sphere for each moon. For simplicity’s sake, create only two moons for any planet. The first moon will be Earth’s. Use the top view to follow these steps:
earthMoon
.To help distinguish one gray planet from another, let’s attach simple shaders to each of the planets to give them color. Shaders, in short, are materials that give an object its particular look, whether it is color or a tactile texture. Follow these steps:
After you’ve created and named all the shaders, you can assign appropriate colors to each of the shaders according to the planets they represent.
Mercury | Orange-brown |
Venus | Beige-yellow |
Earth | Blue |
Mars | Red-orange |
Jupiter | Yellow-green |
Saturn | Pale yellow |
Uranus | Cyan |
Neptune | Aqua blue |
Pluto | Bright gray |
Figure 2-14 shows the shading groups.
Now that you’re finished, you’re ready to animate. Save this file; if you enabled Incremental Save as recommended earlier, your file won’t be replaced with subsequent saves.
To begin this phase of the project, load the file Planets_v2.mb
in the
Scenes folder of the Solar_System project on the web page to your hard drive, or
continue with your own scene file.
The animation you’ll do for the planet’s self-rotation is straightforward. You’ll rotate the planets around their own axes for their self-rotation, and then you’ll animate the moons around the planets for their lunar orbits. Finally you’ll make the planets and their moons orbit the Sun.
This exercise focuses on hierarchy and pivot points. A pivot point is an object’s center of balance of sorts. Every object or node created in Maya has a pivot point, especially primitives like you’re creating here. That pivot point is usually at the center of the primitive and moves along with the object if it’s moved.
Now, you need to set up the animation settings for your scene file:
Now you’re ready to animate Mercury’s rotation. Follow these steps:
Conversely, instead of RMB+clicking Rotate Y in the Channel Box, you could also set a keyframe through the main menu bar (in the Animation menu set) by selecting Animate ⇒ Set Key. However, this method will set a keyframe for all attributes of the Mercury sphere, which is not efficient. You should ideally try to set keyframes only on attributes you need.
You have the self-rotation for Mercury worked out. Mercury has no moon, so let’s get Mercury orbiting the Sun.
You’ve learned that every object in Maya is created with a pivot point around which it rotates and scales and which acts as the placement for its X-, Y-, and Z-coordinates. To orbit Mercury around the Sun sphere, the sphere must revolve around a pivot point that is placed in the middle of the Sun sphere. If the pivot point for Mercury is already at the center of itself, how can you revolve it around the Sun sphere?
One idea is to move its current pivot point from the center of itself to the center of the Sun sphere. That would, however, negate Mercury’s own rotation, and it would no longer spin around its own center, so you can’t do that. You need to create a new pivot point for this object. This way, you have the original pivot point at Mercury’s center so it can self-rotate, and you have a second pivot point at the Sun sphere so that Mercury can revolve around that point around the Sun sphere. You’ll accomplish this by creating a new parent node above Mercury in the hierarchy. What does that mean?
To explain, I’ll take time in the following section to introduce the concept of Maya object structure: nodes and hierarchies. Save your progress so far and open a new blank scene. After this explanation, you’ll resume the solar system exercise.
On top of everything you see in Maya (its interface) is a layer you don’t see: the code. The layer of code keeps the objects in Maya organized through a network of nodes. How you relate these nodes defines how you’ve built your scene. So, having a solid understanding of how Maya defines objects and how they interact is essential to an efficient and successful animation process.
At its core, Maya relies on packets of information called nodes, and each node carries with it a group of attributes that in combination define an object. These attributes can be spatial coordinates, geometric descriptors, color values, and so on. You can define, animate, and interconnect any or all of these attributes individually or in concert, which gives you amazing control over a scene.
Nodes that define the shape of a surface or a primitive are called creation nodes or shape nodes. These nodes carry the information that defines how that object is created. For example, a sphere’s creation node has an attribute for its radius. Changing that attribute changes the radius of the sphere at its base level, making it a bigger or smaller sphere. This is different from scaling the sphere as you’ve done with the planets so far. Shape nodes are low on the hierarchy chain and are always child nodes of transform nodes. The sphere listens to its creation node attributes first and then moves down the chain to its other nodes’ attributes (such as position, rotation, or scale).
The most visible and used nodes are the transform nodes, also known as directed acyclic graph (DAG) nodes. These nodes contain all the transformation attributes for an object or a group of objects below it. Transformations are the values for translation (position), rotation, and scale. These nodes also hold hierarchy information about any other children or parent nodes to which they’re attached. When you move or scale an object, you adjust attributes in this node.
A parent node is simply a node that passes its transformations down the hierarchy chain to its children. A child node inherits the transforms of all the parents above it. So, by using hierarchies for the solar system exercise, you’ll create a nested hierarchy of parents and children to animate the orbital rotation of the nine planets and some of their moons.
With the proper hierarchy, the animation of the planet (the parent) orbiting the Sun automatically translates to the moon (the child). In effect, the planet takes the moon with it as it goes around the Sun.
Child nodes have their own transformations that can be coupled with any inherited transforms from their parent, and these transformations affect them and any of their children down the line.
You’re about to experience this first hand as you continue the solar system exercise. The more you hear about these concepts in different contexts, the easier they will be to master.
Figure 2-19 shows the Outliner and Hypergraph views with a simple hierarchy of objects for your reference. The Outliner and Hypergraph show you the objects in your scene in an outline and flowchart format, respectively. Both of these windows allow you to access the different levels of nodes (the hierarchy) in a scene and are discussed further in Chapter 3.
A top parent node called group1 holds its children pCube1, pCylinder1, and the nested group node group2. The node group2 is the parent node of pCone1 and pSphere1.
If you still feel a little unsure about nodes and hierarchies, take the time to reread the previous section. You’ll practice these concepts as you resume the solar system exercise. By the time you’ve finished this exercise, you’ll have a strong sense of how hierarchies work in Maya, although you should feel free to repeat the entire exercise if you think that will help you master hierarchies. Understanding nodes and hierarchies is absolutely critical to animating in Maya.
If you’re new to CG animation, take your time with the following section.
Load your scene from where you last saved it. When you left off, you had created the self-rotation animation for Mercury and were about to create a second pivot point for the planet to orbit around the Sun sphere by creating a new parent node for the Mercury sphere.
To create a new pivot point by making a new parent node, follow these steps:
You just created a new Maya object by grouping Mercury to itself. In doing so, you also created a second pivot point for Mercury, which was placed by Maya at the origin by default. Because an object’s manipulator always appears at the object’s pivot point when it’s selected, Mercury’s Rotate manipulator jumped to the origin when the new parent node was created. That is fortunate for you because that happens to be the center of the Sun sphere—exactly where you need it to be for Mercury to orbit the Sun sphere properly.
Does that make good sense? You’ll have the chance to do this a few more times as you animate the other planets and their moons. However, if you still find yourself a little fuzzy on this concept (which is perfectly normal), repeat the steps to animate Mercury in a new scene file if need be. One down, eight to go.
For your next planet, Venus, follow the same procedure as for Mercury’s self-rotation (steps 1–6 in the “Mercury’s Rotation” section) and animate it so that it rotates around itself, just like Mercury. Then, create a new pivot point by grouping Venus to itself to create a new parent node (as you did for Mercury_Orbit in steps 1–2 in the previous section) and call the new parent node Venus_Orbit. Lastly, animate Venus_Orbit to revolve around the Sun sphere just as you did with Mercury_Orbit in steps 3–7.
Now you need to animate the third planet, Earth, in much the same way, except that this time there will be the added complication of a moon. (Earth? Hey, I can see my house from here!)
To animate Earth and the moon, follow these steps:
This time, however, you need the pivot point to be at the center of Earth and not at the center of the Sun object, where it is currently. Follow these steps:
To animate Earth’s orbit of the Sun, you need to make sure the moon will also follow Earth around the Sun sphere. Instead of just selecting Earth and grouping it to itself as you’ve done for the other two planets, you need to include the Moon_Orbit node in that group. Follow these steps:
Now the first three planets are going around themselves and around the Sun, with a moon for Earth. If you haven’t been saving your work, save it now. Just don’t save over the unanimated version from earlier.
Repeat this animation procedure for the remaining planets and moons, but leave out Pluto for now. (Poor Pluto: first it loses out on being a planet, and now it has to wait for last.)
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 at a different frame, Maya will set a keyframe at that 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 the moon orbiting Mars, follow these steps:
The Outliner is an outline listing of all the objects and nodes in your scene. For an in-depth look at the Outliner, see Chapter 3. For 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 2-23. Choose Window ⇒ Outliner to open the Outliner window and take a peek at what you have. If you haven’t yet properly named everything, including the moons, take this opportunity to do so by double-clicking a name in the Outliner and entering a new name.
Let’s 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 the planets that have just one or no moon).
At the bottom of the hierarchy are Mars’s two moons, mars_moon and mars_moon2. Each of those moons is spinning on its own pivot point. You grouped each moon to itself, created the mars_moon_orbit and mars_moon2_orbit nodes, and placed their pivot points at the center of Mars to animate their orbits around Mars.
Mars is spinning on its own pivot point, but it needed another pivot point to be able to orbit the Sun. Because you had 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. You called this node Mars_Orbit. This is the parent node because it’s the topmost node for this group. Wherever this parent node goes, the child nodes that are under it will follow.
Hierarchies such as this are a cornerstone of Maya animation. It’s imperative that you’re comfortable with how they work and how to work with them. If you find yourself scratching your head even a little, try the exercise again. A proper foundation is critical. Remember, this learning 3D thing isn’t easy, but patience and repetition help a lot.
One of the most common problems you’ll run into with this project is a planet revolving around the Sun without its moon. To illustrate how to fix it using the Outliner, as opposed to undoing and redoing it as suggested earlier, the following steps will force you to make this error with Pluto. Usually, people learn more from mistakes than from doing things correctly.
Go to Pluto, start the same animation procedure as outlined earlier, and then follow these steps to force an error:
When 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 sphere for both.
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 because it’s no longer attached to Pluto_Orbit, there’s no moon orbit of Pluto.
Figure 2-24 shows the hierarchy of Pluto and how it’s different from that of the other planets: the moon’s orbit node has been left out of the group. (Earth has been expanded as a contrasting example.)
Using the Outliner, you can easily fix this problem. 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 use the middle mouse button to 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 2-25.
You’ve 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. Use the MMB to drag pluto_moon onto pluto_moon_orbit. When you play back the animation, you’ll see that the moon is revolving around the planet and that Pluto and the moon are orbiting the Sun sphere. Now that you’ve corrected Pluto’s layout in the Outliner, it’s similar to the layouts for the other properly working planets.
The file Planets_v3.mb
in the Scenes folder of the Solar_System project
on the book’s web page will give you an idea of how this project should look. The
first five planet systems are grouped and animated as a reference, leaving the final
four for you to finish.
What’s the use of animating all this work and not being able to show it? There are several ways of outputting your work in Maya, most of which involve rendering to images. One faster way of outputting your animation in a simple shaded view is called playblasting. Playblasting creates a sequence of images that play back on your computer at the proper frame rate. Only if your PC is slow or if you’re playblasting a large sequence of frames will your playback degrade. In this case, playblasting 240 frames shouldn’t be a problem.
A playblast, as it’s called in Maya, outputs the view panel’s view into an image sequence or AVI movie. You can also save the image sequence or AVI to disk if you like. Playblasting is done mainly to test the look and animation of a scene, especially when its playback is slow within Maya.
When you have your solar system animated, output a playblast by following these steps:
In this chapter, you learned how to start working in Maya by learning how to navigate the UI. Then, you began working by creating a new project, creating basic objects such as primitives, and placing objects in the scene. You learned how to place pivot points for objects and how to use snaps to place points precisely. You had some experience with the Channel Box and Attribute Editor to set an object’s attributes. You then went on to create simple shaders for your objects and set keyframes to animate a solar system. You explored object hierarchy and grouping conventions to organize your scene better, and finally you learned how to output a basic playblast video file of your completed animation.
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. 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’ll 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.