Chapter 1 Working in Maya CO PY RI GH TE D MA TE RI AL Maya’s working environment has evolved to accommodate both the individual artist as well as a team of artists working in a production pipeline. The interface in Maya 2011 has changed significantly from previous versions of the program to reflect this evolution. The interface presents tools, controls, and data in an organized fashion to easily allow you to bring your fantastic creations to life.
| Chapter 1 Working in Maya of the Maya interface as the tools and controls you use to connect those nodes. The relationship between these nodes is organized by the Dependency Graph, which describes the hierarchical relationship between connected nodes. The interface provides many ways to view the graph, and these methods are described in this chapter. Any given workflow in Maya is much like a route on a city map.
Creating and Editing Maya Nodes Maya has a number of workspaces that enable you to visualize and work with the nodes and their connections. The following sections describe how these workspaces work together when building a node network in a Maya scene. Using the Hypergraph The Hypergraph is a picture of the nodes and their connections in Maya. A complex scene can look like a very intricate web of these connections.
| Chapter 1 Working in Maya Interactive Creation By default Maya creates objects using the Interactive Creation method, which allows you to draw on the canvas as you create your geometry. To turn this feature off, choose the Create Polygon Primitives menu, and deselect the Interactive Creation option at the bottom of the menu.
Creating and Editing Maya Nodes The myCube node is the transform node. The myCubeShape node is the shape node. In the Hypergraph, the shape and transform nodes are depicted as unconnected; however, there is an implied connection, as you’ll see later. This is demonstrated when you rename the myCube node; the shape node is renamed as well. In Maya, the construction history feature stores a record of the changes used to create a particular node.
| Chapter 1 Working in Maya Working with History Over the course of a modeling session, the history for any given object can become quite long and complex. This can slow down performance. It’s a good idea to periodically delete history on an object by selecting the object and choosing Edit Delete By Type History. You can also choose to delete all the history in the scene by choosing Edit Delete All By Type History.
Creating and Editing Maya Nodes Connecting Nodes with the Connection Editor Connections between nodes can be added, deleted, or changed using the Hypergraph and the Connection Editor. 1. Start a new Maya scene. 2. Create a locator in the scene by choosing Create Locator. A simple cross appears at the center of the grid in the viewport. This locator is a simple nonrendering null that indicates a point in space. Locators are handy tools that can be used for a wide variety of things in Maya. 3.
| Chapter 1 Working in Maya locator1 and locator2 are the two transform nodes for the locators. locatorShape1 and locatorShape2 are the two shape nodes for the locators. nurbsSphere1 is the transform node for the NURBS sphere. And nurbsSphereShape1 is the shape node for the sphere; it’s connected to MakeNurbsSphere1, which is the history node, and to initialShadingGroup.
Creating and Editing Maya Nodes Figure 1.8 The Connection Editor specifies which attributes are connected between nodes. 13. Select the Translate attribute on the left. You’ll notice that many of the selections on the right side become grayed out, meaning that they cannot be connected to Translate. This is because Translate is a vector—it is an output consisting of three connections (Translate X, Translate Y, and Translate Z).
| Chapter 1 Working in Maya 17. Select the nurbsSphere1 node in the Hypergraph, and MMB-drag it on top of locator2. 18. From the pop-up list, choose Rotate (see Figure 1.9). The Connection Editor opens again. Figure 1.9 The nurbsSphere1 node is MMBdragged on top of the locator2 node, making the sphere the input connection for locator2.
Creating and Editing Maya Nodes | You can break a connection by reselecting the connected node on either side of the Connection Editor so that the attribute is no longer highlighted. You can also select the connecting line in the Hypergraph and press the Delete key to break the connection. Creating Node Hierarchies in the Outliner The Outliner shows a hierarchical list of the nodes in the scene in a form similar to the outline of a book.
| Chapter 1 Working in Maya In the Outliner, you’ll see three nodes listed: gunBarrels, housing, and mount in addition to the four default cameras and several set nodes (don’t worry about the set nodes). These are the three transform nodes for the pieces of the minigun. Select each node, and you’ll see the corresponding part highlighted in the perspective view. At the moment, each piece is completely separate and unconnected. 4. Select the housing node, and switch to the Rotate tool (hot key = e). 5.
Creating and Editing Maya Nodes | 10. Select the gunBarrels node, and try rotating and translating the object; then rotate and translate the housing node. You’ll see the gun barrels maintain their position relative to the housing node. You could create an animation in which the gun barrels rotate on their own z-axis to spin around while firing, while the housing node is animated, rotating on all three axes in order to aim. 11.
| Chapter 1 Working in Maya 20. Select the mount1 node in the Guns hierarchy, and choose Modify Prefix Hierarchy Names. 21. In the pop-up window, type right_. This renames the top node and all its children so that “right_” precedes the name. Do the same with the other mount node, but change the prefix to left_. 22. Select the guns group, and choose Modify Center Pivot. This places the pivot at the center of the group.
Creating and Editing Maya Nodes | Accessing Outliner Options You can right-click in the Outliner to quickly access the Outliner’s display options rather than use the menu at the top of the Outliner. 2. In the Display menu, activate the visibility of attributes by selecting the Attributes (Channels) option. Each node now has an expandable list of attributes. Most of the time you may want this option off because it clutters the Outliner and there are other ways to get to these attributes.
| Chapter 1 Working in Maya Additional viewing options are available in the Show menu, which contains options for displaying only nodes of a certain type. Throughout this book the Outliner will be used extensively, so you’ll have lots of practice working with this panel. To see a finished version of the scene, open miniGun_v02.ma from the chapter1\scenes directory on the DVD. Searching Features in the Outliner A complex scene in Maya can easily have hundreds of nodes.
Creating and Editing Maya Nodes | The following images show variations on how to search through the Outliner with this method. If nothing appears in the Outliner when you type some text, check to see whether the asterisk is in the right place. To find one specific node, type its full name without the asterisk. The Channel Box The term channel is, for the most part, interchangeable with attribute. You can think of a channel as a container that holds the attribute’s value.
| Chapter 1 Working in Maya There are two tabs on the very right side of the screen that allow you to quickly switch between the Channel Box and the Attribute Editor, as shown in Figure 1.15. (The Attribute Editor is discussed in detail later in this chapter.) These tabs are visible when both the Attribute Editor icon and the Channel Box icon are activated on the status bar in the upper-right corner of the interface. Figure 1.
Creating and Editing Maya Nodes | The lower half of the Channel Box lists the connections to this node. You’ll see the name of the associated shape node under SHAPES, and below this a section for the inputs. In this case, the input is the history node, named makeNurbSphere1, which contains the original settings used to create the sphere. If you delete history on the sphere, these attributes will no longer be accessible. 4.
| Chapter 1 Working in Maya The s hot key keyframes everything, even those channels you may not need to keyframe. You can use the Channel Box to keyframe specific channels. 13. Rewind the timeline, and choose Edit Keys Delete Keys to remove all the keyframes on the sphere. 14. Highlight Translate X and Shift+click Translate Z so that the translation channels are all selected. 15. Right-click these values, and choose Key Selected (see Figure 1.18). Figure 1.
Creating and Editing Maya Nodes Locking and Muting Channels You can mute a channel by right-clicking it and choosing Mute Selected from the pop-up menu. When you mute a channel, the keyframes on that channel are temporarily disabled; as long as the channel is muted, the animation will not update. This is useful when you want to disable the keyframes in a channel so that you can focus on other aspects of the animation.
| Chapter 1 Working in Maya Many of the settings can be accessed through the Attribute Editor’s rollout panels. These are collapsible sections of grouped settings. 4. In the Attribute Editor, on the pCube1 tab, click the triangle next to mental ray. This reveals mental ray–specific settings related to the cube. Note that there are subsections under mental ray that are also collapsible. 5. Choose the pCubeShape1 tab at the top of the Attribute Editor.
Creating and Editing Maya Nodes Note that a new tab called Expression1 is added to the top of the Attribute Editor; this is a new expression node that is now part of the cube’s node network. If the number of connected nodes is too large to fit within the tab listing at the top, you can use the two arrow buttons to the right of the tabs to move back and forth between the tab listings.
| Chapter 1 Working in Maya Figure 1.24 The Maya viewport icon bar allows you to choose between shading modes by toggling buttons. The Hypershade comprises several frames. The format of this editor has been updated in Maya 2011. On the left side is a list and a visual menu of the nodes you can create in the Hypershade. The list is divided into sections for the Maya nodes, mental ray nodes, and a customizable list for your own favorites at the very top.
Creating and Editing Maya Nodes Figure 1.26 The Hypershade organizes render nodes and offers a workspace for constructing render node networks. This image shows an example of a shader network graphed in the Work Area. Hypershade Tabs If tabs appear to be missing, you can revert to the default tab layout by choosing Tabs Revert To Default Tabs, as shown here. This clears the current tabs and replaces them with the default Materials, Textures, Utilities, Lights, Cameras, and other default tabs.
| Chapter 1 Working in Maya 6. Select the blinn1 material in the Work Area, and from the menu at the top of the Hypershade choose Graph Input And Output Connections. This displays all the upstream and downstream nodes connected to blinn1. Upstream nodes are nodes that plug into a node and affect its attributes; downstream nodes are ones that are affected by the node. The blinn1SG node is a downstream node known as a shader group, connected to blinn1.
Creating and Editing Maya Nodes Use the Shelf Buttons to Create a New Shader You can assign a new material to a surface using the buttons in the rendering shelf at the top of the Maya interface (shown here). If you select an object and click one of these buttons, a new shader is created and assigned to selected objects. If no objects are selected, then it just creates a new shader, which you’ll find on the Materials tab of the Hypershade. 9.
| Chapter 1 Working in Maya Figure 1.30 The grid texture appears on the cone when the perspective view is set to shaded mode. Figure 1.31 Applying the grid texture to the color channel of the coneShader adds two new nodes to the shader network. 13. Click the place2dTexture1 node in the Work Area, and its attributes will be displayed in the Attribute Editor. 14. Type 0.5 in the first field next to Coverage. This reduces the coverage of the grid texture in U space by one half.
Creating and Editing Maya Nodes | NURBS UV Texture Coordinates NURBS surfaces have their U and V texture coordinates based on the parameterization of the surface, unlike polygon meshes, which require defined UV coordinates. You can use the attributes in the place2dTexture node to position textures on NURBS surfaces. NURBS surfaces are discussed in Chapter 3, and UV coordinates are discussed in Chapter 11. 15.
| Chapter 1 Working in Maya Figure 1.32 A texture node can be MMB-dragged from the Hypershade into an attribute slot in the Attribute Editor. Figure 1.33 The coneShader network has grown with the addition of new nodes. Graphing Shader Networks You can graph the shader network at any time to refresh the view of the connected nodes in the Work Area.
Creating Maya Projects | 21. Select the blinn1SG node, and graph its input and output connections. The cone’s shape node appears (if the bottom caps option was on in the creation options for the NURBS cone, you’ll see a second shape node for the cone’s bottom cap surface). The blinn1SG node is also connected to the render partition and the light linker, which defines which lights are used to light the cone (see Figure 1.34). Figure 1.
| Chapter 1 Working in Maya 2. Choose File Project New. 3. The New Project dialog box opens. In the Name field, type Mastering_Maya_Chapter01. 4. In the Location field, use the Browse button to find where on your computer or network you want the project to be stored, or simply type the path to the directory. The project folder can be a subfolder of another folder if you like (see Figure 1.35). In the Project Locations section, you’ll see a large number of labeled fields.
Creating Maya Projects | The fields contain the name of the subdirectory relative to the project file. So when you choose to use the default settings, all Maya scene files (files with the .mb or .ma file extension) will be stored in a folder labeled Scenes. The path to that folder will be, in this example, Mastering_Maya_Chapter01\Scenes.
| Chapter 1 Working in Maya from having the same project open or overwriting each other’s work. Later in the chapter, you’ll learn how multiple animators can share parts of the scene using file references. It is possible to work on a scene file outside the current project. This happens usually when you forget to set the project using the File Project Set option.
Organizing Complex Node Structures with Assets | Figure 1.37 The Y rotation of each front wheel is connected to the Y rotation of the steering control (left). The X rotation of each front wheel is connected to the Y translate of the steering control, giving the animator the ability to tilt the wheels if needed (right). If you select one of the front_wheel groups in the Outliner, you’ll see that its Rotate Y channel is colored yellow in the Channel Box, indicating it has an incoming connection.
| Chapter 1 Working in Maya Figure 1.38 The Z rotation of the wheels is controlled by an expression node. The expression node is a separate tab in the Attribute Editor. 8. In the Outliner, expand the vehicle group and the two front_wheel groups. 9. Ctrl+click front_wheel1, wheel1Rotate, front_wheel2, wheel2Rotate, and the steering curve node. 10. Open the Hypergraph in connections mode (Window Hypergraph:Connections). 11.
Organizing Complex Node Structures with Assets The Options Box The small square to the right of a listing in the menu indicates the options. When you select just the listing in the menu, the action will be performed using the default settings. When you click the Options box to the right of the menu listing (shown here), a dialog box will open allowing you to change the options for the action.
| Chapter 1 Working in Maya 17. Click Apply and Close to create the asset. In the Hypergraph, you’ll see a gray box labeled front_wheels; this box is also visible in the Outliner. The time1 and vehicle nodes are still visible in the Hypergraph. It may appear as though they have been disconnected, but that’s not actually the case. 18. Select the front_wheels asset in the Hypergraph, and graph its input and output connections (Graph Input And Output Connections).
Organizing Complex Node Structures with Assets | Tips on Working with Assets Here are some tips for working with assets: •u To delete an asset, select it and choose (from the Hypergraph menu) Edit Asset Remove Asset. Don’t select the asset and delete it; deleting the asset will delete the contents from the scene as well. •u You can remove all the assets in a scene, without deleting their contents, by choosing Edit Delete By Type Assets.
| Chapter 1 Working in Maya Figure 1.42 The Translate Y attribute of the steering node is published to the container under the name wheelTilt. Publish Attributes from the Attribute Editor If you need to publish a specific attribute that does not appear in the Channel Box, you can open the Attribute Editor for the appropriate node, right-click the attribute name, and choose the publish options from the pop-up menu.
Organizing Complex Node Structures with Assets Figure 1.43 Attributes can be published to the container from within the Asset Editor. Note that steps 5 and 6 are just another way to publish an attribute; the end result is the same as when you published the wheelTilt attribute from the Channel Box in the previous section. 7. Steer now appears in the right side of the Asset Editor. The view on the right side of the Asset Editor shows the attributes grouped by node.
| Chapter 1 Working in Maya File References File referencing is another workflow tool that can be used when a team of artists is working on the same scene. For example, by using file references, an animator can begin animating a scene while the modeler is still perfecting the model. This is also true for any of the other team members. A texture artist can work on textures for the same model at the same time.
File References Figure 1.45 The referenced vehicle appears in the scene with its associated containers. 5. In the Outliner, select the carAnimation locator, and then Ctrl+click the vehicleReference_v01:vehicle node. 6. Switch to the Animation menu set, and choose Constrain Parent Options. 7. In the options for the Parent constraint, turn off Maintain Offset, make sure both Translate All and Rotate All are selected, and set the weight to 1. 8. Click Add to make the constraint.
| Chapter 1 Working in Maya Figure 1.46 The changes made to the body shape and color in the vehicleReference _v01.ma file are reflected in the referenced model in the street scene. This is the basic file referencing workflow; however, a file referencing structure can be made much more complex to accommodate the needs of multiple teams. In addition, a referenced file can also use other references so that a file referencing tree can be constructed layering several levels of file references.
File References Figure 1.47 In the file reference options, make sure Group is on if you want to animate the reference and proxies. 5. In the Outliner, MMB-drag the vehicleReference_v01RNlocator on top of the carAnimation locator. 6. Then select the vehicleReference_v01RNlocator, open the Channel Box, and set all of its Translate and Rotate channels to 0 (Figure 1.48). Figure 1.
| Chapter 1 Working in Maya 7. Choose File Reference Editor to open the Reference Editor window. 8. In the bottom half of the Reference Editor window, select the vehicleReference_v01RN node. Choose Proxy Add Proxy Options. 9. In the Proxy Options, type loRes into the Set Proxy Tag To field. Click the Apply button. 10. Use the File Browser dialog box to choose the loResCar_v01.ma scene from the chapter1\ scenes directory on the DVD. 11.
The Bottom Line | The Bottom Line Understand transform and shape nodes DAG nodes have both a transform node and a shape node. The transform node tells where an object is located; the shape node describes how it is made. Nodes can be parented to each other to form a hierarchy. Master it Arrange the nodes in the miniGun_v03.ma file in a hierarchical structure so the barrels of the guns can rotate on their z-axis, the guns can be aimed independently, and the guns rotate with the turret.