Chapter 1 AL Working in Autodesk Maya CO PY RI GH TE D MA TE RI 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 presents tools, controls, and data in an organized fashion to easily allow you to bring your fantastic creations to life. Maya’s interface is made up of four views: the perspective, front, side, and top. Each camera can be customized. Additional cameras can also be created.
| Chapter 1 Working in Autodesk Maya building blocks you, as the artist, put together to create the 3D scene and animation that will finally be rendered for the world to see. So if you can think of the objects in your scene, their motion, and appearance as nodes, think 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.
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 Autodesk 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 Autodesk 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 the history of all the objects in the scene at once 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 Autodesk Maya Figure 1.6 The input and output connections of the two locators and the sphere are graphed in the Hypergraph. 10. Select the locator1, locator2, and nurbsSphere1 nodes, and drag them away from the other nodes so you can work on them in their own space. 11. In the Hypergraph, MMB-drag the locator1 node over the nurbsSphere1 node. 12. From the pop-up menu, choose Other at the bottom (Figure 1.7). A new dialog box will open; this is the Connection Editor. Figure 1.
Creating and Editing Maya Nodes The Connection Editor is where you create and edit connections between nodes. The left side of the panel represents the output of a selected node, in this case the locator1 node. The output is the controlling node; the right side is the input, and in this case is nurbsSphere1, which will be controlled based on whatever connections you make in the list. The list represents the attributes of each node.
| Chapter 1 Working in Autodesk Maya 14. On the right side, scroll down and select Translate. Both connections in the list are now italicized, indicating that there is a connection to this attribute. If one of the other attributes on the right were italicized, it would indicate that another node is already connected to that attribute (see Figure 1.8). Once the connection is created, you can close the Connection Editor. 15.
Creating and Editing Maya Nodes | Specifying Connections In some cases when you choose to make a connection from the pop-up window, Maya will automatically make it for you without opening the Connection Editor; however, in other cases, even when you choose what seems like an obvious connection from the list, Maya will still open the Connection Editor so you can make exactly the connection you want. 19. Now the nurbsSphere1 node is listed on the left, and locator2 is on the right.
| Chapter 1 Working in Autodesk Maya Outliner Layout Presets The Outliner can be opened as a separate panel or, like many of the panels in Maya, can be opened in a viewport. A popular window arrangement is to split the viewports into two views, with the left view set to the Outliner and the right view set to the perspective view. You can open this arrangement by going to the menu bar in a viewport window and choosing Panels Saved Layouts Persp/ Outliner.
Creating and Editing Maya Nodes | 7. In the Outliner, select the gunBarrels object. Then Ctrl+click the housing object (Cmd+click on the Mac), and choose Edit Parent from the main Maya menu at the top. Parenting one object to another means you have made one transform node the child of the second. When an object is a child node, it inherits its position, rotation, scale, and visibility from the parent node.
| Chapter 1 Working in Autodesk Maya Shift+click to Expand the Hierarchy You can expand an entire hierarchy with one click in the Outliner. Just Shift+click the plus sign for the hierarchy you want to expand. 14. Select the mount node, and choose Edit Duplicate (hot key = Ctrl+d). This makes a copy of the entire hierarchy. The duplicated mount node is named mount1. 15. Select the mount1 node, and switch to the Move tool (hot key = w).
Creating and Editing Maya Nodes Figure 1.12 The guns group is rotated as a single unit. Each member of the hierarchy can have its own animation, so both gun barrels can rotate around their z-axes as they fire, the two housing nodes could be animated to aim in different directions, and the two guns could rotate as one unit, all at the same time. The entire group can be parented to another node that is part of a vehicle.
| Chapter 1 Working in Autodesk Maya 3. Turn off the Attributes display, and turn off the DAG Objects Only option. This allows you to see all the nodes in the scene in the Outliner list as opposed to just the DAG nodes. DAG stands for “directed acyclic graph,” and DAG objects are those objects that have both a shape and a transform node.
Creating and Editing Maya Nodes 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. 4. In the Display menu of the Outliner, turn the DAG Objects Only option back on. Save the scene as minGun_v02.ma. To see a finished version of the scene, open miniGun_v02.ma from the chapter1\scenes directory on the DVD.
| Chapter 1 Working in Autodesk Maya 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. The Channel Box is an editor that lists a node’s attributes for quick access. The Channel Box displays the node’s attributes, which are most frequently keyframed for animation.
Creating and Editing Maya Nodes | Figure 1.15 The two tabs on the right of the screen allow you to quickly switch between the Channel Box and the Attribute Editor. This exercise gives a quick tour of how to work in the Channel Box: 1. Create a new scene in Maya, and create a NURBS Sphere on the grid (Create NURBS Primitives Sphere). You’ll be prompted to draw the sphere on the grid if Interactive Creation mode is on; if not, the sphere will appear at the center of the grid. Either option is fine.
| Chapter 1 Working in Autodesk Maya 3. The Channel Box will list the currently selected object. Select the sphere, and you’ll see nurbsSphere1 appear. The list below it shows the attributes for the nurbsSphere1’s transform node. 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.
Creating and Editing Maya Nodes | 11. Move the timeline to frame 24, and change some settings on both the transform node (the upper half of the Channel Box) and under makeNurbSphere1 in the INPUTS section. 12. Press the s hot key again to set another key. Play the animation, and you’ll see the sphere update based on the keyframed changes. If the animation seems to play too quickly, you need to change the preferences so that playback matches the frame speed of the animation.
| Chapter 1 Working in Autodesk Maya 18. To remove keys, you can highlight the channels, right-click, and choose Break Connections. This removes any inputs to those channels. The values for the current keyframe will remain in the channels. The channels are color coded to show what kind of input drives the channel: •u Pink indicates a keyframe. •u Purple indicates an expression. •u Yellow indicates a connection (as in a connection from another node or channel made in the Connection Editor).
Creating and Editing Maya Nodes Figure 1.19 The Show Or Hide The Attribute Editor icon resides in the upper-right corner of the Maya interface. 3. With the Attribute Editor open, choose the pCube1 tab at the top (Figure 1.20). The panel that opens contains the attributes for the cube’s transform node, much like the upper section of the Channel Box described in the previous section. It also contains options for setting limits on the transform attributes. Figure 1.
| Chapter 1 Working in Autodesk Maya Figure 1.21 Right-clicking an attribute field reveals a menu with options for animating the attribute value. Figure 1.22 You can enter simple mathematical expressions directly into a field in the Attribute Editor. 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.
Creating and Editing Maya Nodes | Load Attributes You can use the Load Attributes button at the bottom of the Attribute Editor if the attribute display needs to be refreshed. Maya automatically updates the editor when new attributes are added, but occasionally it misses an update and needs to be refreshed. The Attribute Editor is the workhorse panel of Maya. Throughout this book we will use it constantly.
| Chapter 1 Working in Autodesk Maya Figure 1.25 The text field at the top of the Create tab allows you to filter the list of buttons. MMBdragging a button on top of the Favorites section adds the node to the Favorites. The right side of the Hypershade contains a visual display of the nodes in the scene at the top and the Work Area at the bottom (Figure 1.26).
Creating and Editing Maya Nodes | 4. On the left side of the Hypershade, click Surface in the list of Maya nodes. Click the Blinn button to create a new Blinn material. You can see the new blinn1 material listed on the Materials tab; it also appears 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.
| Chapter 1 Working in Autodesk Maya Figure 1.27 Shaders all have shading group nodes attached, which define how the shader is applied to the geometry. 6. In the viewport, select the cone. You can apply the blinn1 material in several ways to the cone: •u MMB-drag the material icon from the Hypershade on top of the cone in the viewport window. •u Select the cone, right-click the blinn1 node in the Hypershade, and choose Assign Material To Selection (Figure 1.28). Figure 1.
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. Click the checkered box to the right of the Color slider.
| Chapter 1 Working in Autodesk Maya Figure 1.30 The grid texture appears on the cone when the perspective view is set to shaded mode. 11. Select coneShader in the Work Area of Hypershade, and right-click its icon. Choose Graph Network. You’ll see that the coneShader node now has the grid1 texture node as well as the place2dTexture1 node attached (Figure 1.31). Figure 1.31 Applying the grid texture to the color channel of the coneShader adds two new nodes to the shader network.
Creating and Editing Maya Nodes | 13. Type 0.5 in the first field next to Coverage and press Enter. This reduces the coverage of the grid texture in U space by one half. 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.
| Chapter 1 Working in Autodesk Maya Figure 1.32 A texture node can be MMB-dragged from the Hypershade into an attribute slot in the Attribute Editor. 19. Select the coneShader node in the Work Area of the Hypershade, and choose Graph Input And Output Connections from the Hypershade menu. In the Work Area, you can see that the ramp texture is connected to the grid1 texture. The grid1 texture is connected to the coneShader, and the shader is connected to the blinn1SG node (see Figure 1.33).
Creating Maya Projects | Graphing Shader Networks You can graph the shader network at any time to refresh the view of the connected nodes in the Work Area. Just right-click the node you want to graph and choose Graph Network, or click the Input/ Output connections button at the top of the Hypershade (shown here). More options for displaying the network are available in the Graph menu at the top of the Hypershade. Figure 1.
| Chapter 1 Working in Autodesk Maya Creating a New Project Creating a new project is very simple. Projects can be created on your computer’s primary hard drive, a secondary drive, or a network drive. The scene files used for each chapter in this book are stored in their own project directories on the DVD that comes with the book. Maya uses a default project directory when one has not been specified.
Creating Maya Projects | Figure 1.36 Clicking the New button fills in all the fields with Maya’s preferred default file structure (left side of the image). The directory structure is created on the specified drive (right side of the image). 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.
| Chapter 1 Working in Autodesk Maya into any one of these fields or click the folder icon to browse your computer’s directory. Then click the Accept button. If a folder does not already exist, Maya will create it for you. Relinking Files After Changing Project Settings If you edit the project, Maya will look in the newly specified folders from this point on, but files used prior to editing the project will not be copied or moved.
Organizing Complex Node Structures with Assets | in a scene can be a daunting task. Assets are a workflow management tool designed to help a director separate the nodes in a scene and their many attributes into discrete interfaces so each team of specialized artists can concern itself only with its own part of the project. Assets are a collection of nodes you choose to group together for the purpose of organization.
| Chapter 1 Working in Autodesk Maya If you look in the Channel Box for either of the front_wheel groups, you’ll see that the Rotate X channel is colored orange, indicating that it has been keyframed. In fact, the Rotate channels of the group use what’s known as a driven key to determine their values. The keyframe’s driver is the Y translation of the arrow group. You’ll learn more about using this technique in Chapter 5. 6. Select the vehicle group node. 7.
Organizing Complex Node Structures with Assets | Figure 1.39 The vehicle group is expanded, and several of the nodes related to the front wheels are selected and graphed on the Hypergraph. 14. In the Hypergraph menu, choose Edit Asset Advanced Assets Create Options (Options is selected by clicking the small square to the right of the command list in the menu). The Options Box The small square to the right of a listing in the menu indicates the options.
| Chapter 1 Working in Autodesk Maya Figure 1.40 The options are set for the container that will hold all the selected nodes in the Hypergraph. 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.
Organizing Complex Node Structures with Assets | 20. Double-click the thick border of the asset to collapse it, or click the Collapse Selected Assets icon at the top of the Hypergraph. You can select a node inside the container and remove it from the container by right-clicking the node and choosing Remove From Container. 21. Save the scene as vehicle_v02.ma.
| Chapter 1 Working in Autodesk Maya 3. In the Channel Box, select the Translate Y channel, and from the Edit menu in the Channel Box, choose Publish To Asset Options. 4. In the Publish Attribute Options dialog box, choose both Selected Channel Box Attributes and Custom Name. 5. Type wheelTilt in the Custom String field. Click Apply and then click Close (see Figure 1.42). Figure 1.42 The Translate Y attribute of the steering node is published to the container under the name wheelTilt. 6.
Organizing Complex Node Structures with Assets The Asset Editor opens in view mode. In the list of assets on the left, you can click the plus sign in the square to see the nodes contained within each container. You can see the attributes of each node listed by clicking the plus sign in the circle next to each node. 3. Select the front_wheels container, and click the pushpin icon above and to the right of the asset list to switch to edit mode.
| Chapter 1 Working in Autodesk Maya 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. If you want to see just the published attributes, choose View Mode Flat from the Asset Editor’s menu bar. 8. Select the front_wheels asset in the Outliner, and open its Attribute Editor. 9. Expand the Asset Attributes rollout, and turn on Black Box (see Figure 1.44).
File References File Referencing vs. Importing File referencing is not the same as importing a Maya scene into another Maya scene. When you import a Maya scene, all the imported nodes become fully integrated into the new scene and have no links to any external files. On the other hand, file references maintain a link to external files regardless of whether the referenced files are open or closed.
| Chapter 1 Working in Autodesk Maya In the Outliner, you’ll see the vehicleReference_v01:vehicle node as well as the vehicleReference_v01:front_wheels and carPaint container nodes. The container node is an asset with both the wheelTilt and steer attributes created in the previous section. Referencing Maya Scenes You don’t need to do anything special to the scene you want to reference; it can be a standard Maya scene.
File References | 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 use other references so that a file referencing tree can be constructed by layering several levels of file references.
| Chapter 1 Working in Autodesk Maya Figure 1.47 In the file reference options, make sure Group is on if you want to animate the reference and proxies. Reference Grouping For the reference and proxy to share the same translation, rotation, and scale animation, the reference must have Group enabled when it is brought into the scene. Otherwise, when you animate the proxy and then switch to the reference, animation placed on the transform node of the proxy will not be transferred to the reference. 4.
File References | 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.48 The vehicle Reference_ v01RNlocator is parented to the carAnimation locator, and all of its Translate and Rotate channels are set to 0 so it follows the animation of the carAnimation locator. 7. Choose File Reference Editor to open the Reference Editor dialog box. 8.
| Chapter 1 Working in Autodesk Maya 14. From the menu bar in the Reference Editor, choose Proxy Reload Proxy As vehicleReference_v01PM1 (loResCarv01.ma). After a moment, the original vehicle is replaced with the lower-resolution version. 15. Try using this menu to switch to the mediumRes version of the vehicle. The vehicle should be replaced with a slightly higher-resolution version. If you play the animation, the vehicle still moves along the animation curve (Figure 1.49). Figure 1.
The Bottom Line Master It Create an asset from the nodes in the miniGun_v04.ma scene in the chapter1\scenes folder. Make sure that only the Y rotation of the turret, the X rotation of the guns, and the Z rotation of the gun barrels are available to the animator. Create file references. File references can be used so that as part of the team works on a model, the other members of the team can use it in the scene.