cover
titlepage

Table of Contents

Cover

Introduction

Who Should Buy This Book

What’s Inside

Conventions

How to Contact the Author

Chapter 1: Working in Autodesk Maya

Creating and Editing Nodes

Creating Maya Projects

Organizing Complex Node Structures with Assets

File References

The Bottom Line

Chapter 2: Virtual Filmmaking

Determining the Image Size and Film Speed of the Camera

Creating and Animating Cameras

Creating Custom Camera Rigs

Applying Depth of Field and Motion Blur

Using Orthographic and Stereo Cameras

Using the Camera Sequencer

The Bottom Line

Chapter 3: Modeling I

Understanding Polygon Geometry

Using Subdivision Surfaces

Understanding NURBS

Employing Image Planes

Modeling NURBS Surfaces

NURBS Tessellation

Modeling with Polygons

The Bottom Line

Chapter 4: Modeling II

Modeling with Deformers

Combining Meshes

Using Bevel Plus

Using Curves

Converting NURBS Surfaces to Polygons

Boolean Operations

Sculpting Polygons Using Artisan

Advanced Polygon-Editing Tools

The Bottom Line

Chapter 5: Animation Techniques

Using Joints and Constraints

Inverse Kinematics

Keyframe Animation

The Graph Editor

Playblast and FCheck

Driven Keys

Motion-Path Animation

Motion Trails

Animating Constraints

Animation Layers

Grease Pencil

The Bottom Line

Chapter 6: Animating with Deformers

Animating Facial Expressions Using Blend Shapes

Animating Blend Shapes Sequentially

Animating with Lattices

Animating Object Components with Clusters

Animating a Scene Using Nonlinear Deformers

Creating a Jiggle Effect

Optimizing Animations with the Geometry Cache

The Bottom Line

Chapter 7: Rigging and Muscle Systems

Understanding Rigging

Creating and Organizing Joint Hierarchies

Rigging the Giraffe

Human Inverse Kinematics

Skinning Geometry

The Maya Muscle System

The Bottom Line

Chapter 8: Paint Effects

Using the Paint Effects Canvas

Painting on 3D Objects

Understanding Strokes

Designing Brushes

Create Complexity by Adding Strokes to a Curve

Shaping Strokes with Behavior Controls

Animating Strokes

Rendering Paint Effects

The Bottom Line

Chapter 9: Lighting with mental ray

Shadow-Casting Lights

Indirect Lighting: Global Illumination

Indirect Illumination: Final Gathering

Image-Based Lighting

Physical Sun and Sky

mental ray Area Lights

Light Shaders

The Bottom Line

Chapter 10: mental ray Shading Techniques

Shading Concepts

Creating Blurred Reflections and Refractions Using Standard Maya Shaders

Basic mental ray Shaders

Car Paint Materials

The mia Material

Controlling Exposure with Tone Mapping

Rendering Contours

The Bottom Line

Chapter 11: Texture Mapping

UV Texture Layout

Bump and Normal Mapping

Displacement Mapping

Subsurface Scattering

Viewport 2.0

The Bottom Line

Chapter 12: Rendering for Compositing

Render Layers

Render Passes

Render Pass Contribution Maps

Setting Up a Render with mental ray

mental ray Quality Settings

The Bottom Line

Chapter 13: Introducing nParticles

Creating nParticles

Making nParticles Collide with nRigids

Using nParticles to Simulate Liquids

Emit nParticles Using a Texture

Using Wind

Shading nParticles and Using Hardware Rendering to Create Flame Effects

nParticles and Fields

Rendering Particles with mental ray

The Bottom Line

Chapter 14: Dynamic Effects

Creating nCloth Objects

Creating nCloth and nParticle Interactions

Rigid Body Dynamics

Soft Body Dynamics

Creating Flying Debris Using nParticle Instancing

Animating Instances Using nParticle Expressions

The Bottom Line

Chapter 15: Fur, Hair, and Clothing

Adding Fur to Characters

Rendering Fur Using mental ray

Animating Using Dynamic Curves

Adding Hair to a Character

Styling Hair

Rendering Hair

Creating Clothing for Characters

Painting nCloth Properties

The Bottom Line

Chapter 16: Maya Fluids

Using Fluid Containers

Fluid Interactions

Rendering Fluid Containers

Create Fluids and nParticle Interactions

Creating Water Effects

The Bottom Line

Appendix A: The Bottom Line

Chapter 1

Chapter 2

Chapter 3

Chapter 4

Chapter 5

Chapter 6

Chapter 7

Chapter 8

Chapter 9

Chapter 10

Chapter 11

Chapter 12

Chapter 13

Chapter 14

Chapter 15

Chapter 16

Appendix B: Autodesk Maya 2014 Certification

Acquisitions Editor: Mariann Barsolo

Development Editor: Candace Cunningham

Technical Editor: Chip Weatherman

Production Editor: Elizabeth Campbell

Copy Editor: Liz Welch

Editorial Manager: Pete Gaughan

Production Manager: Tim Tate

Vice President and Executive Group Publisher: Richard Swadley

Vice President and Publisher: Neil Edde

Book Designers: Maureen Forys, Happenstance Type-O-Rama with Judy Fung

Compositor: Maureen Forys, Happenstance Type-O-Rama

Proofreader: Sara Eddleman-Clute, Word One, New York

Indexer: Ted Laux

Project Coordinator, Cover: Katherine Crocker

Cover Designer: Ryan Sneed

Cover Image: Todd Palamar

Dear Reader,

Thank you for choosing Mastering Autodesk Maya 2014. This book is part of a family of premium-quality Sybex books, all of which are written by outstanding authors who combine practical experience with a gift for teaching.

Sybex was founded in 1976. More than 30 years later, we’re still committed to producing consistently exceptional books. With each of our titles, we’re working hard to set a new standard for the industry. From the paper we print on, to the authors we work with, our goal is to bring you the best books available.

I hope you see all that reflected in these pages. I’d be very interested to hear your comments and get your feedback on how we’re doing. Feel free to let me know what you think about this or any other Sybex book by sending me an email at nedde@wiley.com. If you think you’ve found a technical error in this book, please visit http://sybex.custhelp.com. Customer feedback is critical to our efforts at Sybex.

Best regards,

edde_sig.tif

Neil Edde

Vice President and Publisher

Sybex, an Imprint of Wiley

Acknowledgments

I would like to Eric Keller and Lee Lanier, whose work on previous editions has built a foundation for this edition; Anthony Honn, who built the vehicle models used in many of the example scenes; Travis Keller, who designed the kitchen and pergola models used in the lighting chapters; and Chris Sanchez, who provided the fantastic spacesuit design used in the modeling chapters. Thanks, also, to Chip Weatherman, our technical editor. Chip’s fresh perspective was much appreciated.

I would also like to thank all the people from Wiley, and a special thanks to Mariann Barsolo, Candace Cunningham, and Elizabeth Campbell for having such great attitudes. Their management and editing skills are superior.

About the Author

Todd Palamar is a 22-year veteran in the computer animation industry. After transitioning early in his career from traditional special effects to computer-generated imagery, Todd did effects work for several direct-to-video movies. He later went on to work on numerous video games, including Sega of Japan’s coin-operated title Behind Enemy Lines, as well as Dukes of Hazzard and Trophy Buck 2 for the Sony PlayStation console. For six years, Todd taught at Full Sail University in Winter Park, Florida. During this time, he received numerous accolades as an outstanding educator. Todd is currently an instructor at the Digital Animation & Visual Effects (DAVE) School at Universal Studios Florida. Todd has written several books, among them Maya Cloth for Characters (Surrealistic Producing Effects, 2008), Maya Studio Projects: Dynamics (Sybex, 2009), and Maya Studio Projects: Photorealistic Characters (Sybex, 2011). The breadth of his experience has allowed him to work on location-based entertainment, military simulations, television commercials, and corporate spots. You can see more of Todd’s work on his company’s website, www.speffects.com.

About the Contributing Authors

Eric Keller is a freelance visual effects artist working in Hollywood. He divides his time between the entertainment industry and scientific visualization. He teaches the Introducing Digital Sculpting class at the Gnomon School of Visual Effects in Hollywood and has authored numerous animation and visualization tutorials for the Harvard Medical School course “Maya for Molecular Biologists,” taught by Gael McGill.

Eric has worked at some of the best design studios in Los Angeles, including Prologue Films, Imaginary Forces, Yu and Company, BLT and Associates, and The Syndicate. Books by Eric Keller include Maya Visual Effects: The Innovator’s Guide, Introducing ZBrush (three editions), Mastering Maya 2009, and Mastering Maya 2011, all published by Sybex. He was a contributing author to Mastering Maya 7 and Mastering Maya 2012. Many of his tutorials are available online at www.bloopatone.com.

Lee Lanier is a visual effects/animation veteran of over 20 years. Formerly a senior animator at PDI/DreamWorks for Antz and Shrek, his credits include a dozen features and numerous short films. In addition, he has taught at several schools, including the Academy of Art University and the Gnomon School of Visual Effects, and has written several books for Sybex, including Maya Studio Projects: Texturing and Lighting (2011). You can view his work at http://beezlebugbit.com/.

Anthony Honn created the vehicle models used in the example scenes throughout this book. Anthony originally trained in industrial design and architecture, but a series of fateful events resulted in a career in the film and design industries. His clients have included recording artists such as Janet Jackson, as well as lifestyle brands such as Nike. Arguably, the industrial designer still lurks beneath, with his continued passion for robotics, automobiles, and furniture.

Contents at a Glance

Introduction

The Autodesk® Maya® program is big. It is really, really huge. The book you hold in your hands and all the exercises within it represent a mere sliver of what can be created in Maya. Mastering Maya takes years of study and practice. I have been using Maya almost every day since 1999, and I’m still constantly facing new challenges and making new discoveries.

This book is meant to be a guide to help you not only understand Maya, but also how to learn about Maya. The title Mastering Autodesk Maya 2014 implies an active engagement with the software. This book is packed with hands-on tutorials. If you’re looking for a quick-reference guide that simply describes each and every button, control, and tool in the Maya interface, turn to the Maya documentation that comes with the software. This book is not a description of Maya; it is an explanation illustrated with practical examples.

The skills you acquire through the examples in this book should prepare you for using Maya in a professional environment. To that end, some features, such as lighting and rendering with mental ray, nDynamics, Fluids, and Maya Muscle, have received more emphasis and attention than others. Features that have not changed significantly over the past few versions of the software, such as Maya Software rendering, standard Maya shaders, and older rigging techniques, receive less attention since they have been thoroughly covered elsewhere.

When you read this book and work through the exercises, do not hesitate to use the Maya help files. We won’t be insulted! The Maya documentation has a very useful search function that allows you to find complete descriptions of each control in the software. To use the help files, click the Help menu in the Maya menu interface. The documentation consists of a large library of Maya resources, which will appear in your default web browser when you access the help files. Experienced Maya artists never hesitate to use the help files to find out more information about the software; there is no shame in asking questions! In addition, hovering over a tool or setting will give you a brief description. Features new to Maya, highlighted in green throughout the interface, have links to larger descriptions as well as movies.

Who Should Buy This Book

This book is written for intermediate Maya users and users who are advanced in some aspects of Maya and want to learn more about other facets of the program. The book is intended to be used by artists who are familiar with Maya and the Maya interface or who have significant experience using similar 3D packages. If you have used older versions of Maya, this book will help you catch up on the features in Maya 2014.

If you have never used Maya or any other 3D software on a computer before, this book will be too challenging, and you will quickly become frustrated. You are encouraged to read Introducing Autodesk Maya 2014,by Dariush Derakhshani (Sybex, 2013) or to read through the tutorials in the Maya documentation before diving into this book.

You should be familiar with the following before reading this book:

  • The Maya interface.
  • Computer image basics such as color channels, masking, resolution, and image compression.
  • Computer animation basics such as keyframes, squash and stretch, and 3D coordinate systems.
  • Standard Maya shaders, such as the Blinn, Phong, Lambert, Layered, and Anisotropic materials, as well as standard textures, such as Fractal, Ramp, Noise, and Checker.
  • Lighting and rendering with standard Maya lights and the Maya software rendering engine.
  • The basics of working with NURBS curves, polygon surfaces, and NURBS surfaces.
  • Your operating system. You need to be familiar with opening and saving files and the like. Basic computer networking skills are helpful as well.

What’s Inside

The topics in this book move in a progressive order from introductory to complex. They also loosely follow a typical production pipeline for starting and completing assets. The following are brief explanations of the contents of each chapter.

There is also a companion website, which is home to all the project files and samples referenced in the book, as well as bonus chapters on MEL scripting and toon shading. Go to www.sybex.com/go/masteringmaya2014 and click the Downloads tab to access the files.


Note
Some of the scene files provided with Mastering Autodesk Maya 2014 may not work with previous versions of Maya, even if the ‘Ignore Versions’ option is checked when you open the file. You may be able to download the previous book’s scene files and use them if you are using a previous version of Maya, however be warned that the scene files from previous editions of the book may not be completely updated to address exercises in the 2014 edition of the book.

  • Chapter 1: Working in Autodesk Maya This chapter discusses how to work with the various nodes and the node structure that make up a scene. Using the Hypergraph, Outliner, Hypershade, Attribute Editor, and Connection Editor to build relationships between nodes is demonstrated through a series of exercises. References and the Asset Editor are also introduced. These features have been created to aid with large Maya projects that are divided between teams of artists.
  • Chapter 2: Virtual Filmmaking This chapter provides an in-depth discussion of the Maya virtual camera and its attributes. A number of exercises provide examples of standard and custom camera rigs. Stereo 3D cameras are also introduced.
  • Chapter 3: Modeling I This chapter introduces the various types of surfaces with which you can model. It walks you through numerous approaches for modeling parts of a helmet for a spacesuit based on a concept drawing created by a professional artist.
  • Chapter 4: Modeling II This chapter continues to build on the model started in Chapter 3, using polygon and subdivision surface techniques. Smooth mesh polygons, creasing, and soft selection are demonstrated on various parts of the model.
  • Chapter 5: Animation Techniques This chapter demonstrates basic rigging with inverse kinematics as well as animating with keyframes, expressions, and constraints. Animation layers are explained.
  • Chapter 6: Animating with Deformers This chapter takes you through the numerous deformation tools available in Maya. Creating a facial-animation rig using blend shapes is demonstrated, along with using lattices, nonlinear deformers, and the geometry cache.
  • Chapter 7: Rigging and Muscle Systems This chapter explains joints, expands on inverse kinematics, and covers smooth binding, and proper rigging techniques. Maya Muscle is introduced and demonstrated on a character’s arm.
  • Chapter 8: Paint Effects This chapter provides a step-by-step demonstration of how to create a custom Paint Effects brush as well as how to animate and render with Paint Effects.
  • Chapter 9: Lighting with mental ray This chapter demonstrates a variety of lighting tools and techniques that can be used when rendering scenes with mental ray. Indirect lighting using global illumination, Final Gathering, and the Physical Sun and Sky network are all demonstrated.
  • Chapter 10: mental ray Shading Techniques This chapter describes commonly used mental ray shaders and how they can be employed to add material qualities to the space helmet created in Chapter 3. Tips on how to use the shaders together as well as how to light and render them using mental ray are offered.
  • Chapter 11: Texture Mapping This chapter demonstrates how to create UV texture coordinates for a giraffe. Applying textures painted in other software packages, such as Adobe Photoshop, is discussed, as are displacement and normal maps and subsurface scattering shaders.
  • Chapter 12: Rendering for Compositing This chapter introduces render layers and render passes, which can be used to split the various elements of a render into separate files that are then recombined in compositing software.
  • Chapter 13: Introducing nParticles This chapter provides numerous examples of how to use nParticles. You’ll use fluid behavior, particle meshes, internal force fields, and other techniques to create amazing effects.
  • Chapter 14: Dynamic Effects This chapter demonstrates a variety of techniques that can be used with nCloth to create effects. Traditional rigid body dynamics are compared with nCloth, and combining nCloth and nParticles is illustrated.
  • Chapter 15: Fur, Hair, and Clothing This chapter discusses how to augment your Maya creatures and characters using Maya Fur, Maya nHair, and nCloth. Using dynamic curves to create a rig for a dragon’s tail is also demonstrated.
  • Chapter 16: Maya Fluids This chapter explains how 2D and 3D fluids can be used to create smoke, cloud, and flame effects, and a demonstration of how to render using the Ocean shader is given. Using nParticles as a Fluid emitter is introduced, as is using Fluids for liquid simulation.
  • Appendix A: The Bottom Line This appendix contains all of the solutions from the Master It section at the end of each chapter.
  • Appendix B: Autodesk Maya 2014 Certification This appendix contains the Autodesk Maya 2014 Certified Professional Objectives table that lists the topic, exam objective, and chapter where the information can be found.

Note
Go to www.autodesk.com/certification to find information about the Maya 2014 Certified Professional exam covered in this book, as well as other Maya certification exams.

Conventions

Navigating in Maya is slightly different in the Windows and Mac operating systems. You can navigate the Hypergraph by using the same hot-key combination you use in the viewport: Alt+MMB-drag/Option+MMB-drag pans through the Hypergraph workspace, and Alt+RMB-drag/Option+RMB-drag zooms in and out. (MMB means clicking with the middle mouse button, and RMB means clicking with the right mouse button.)

It is also important to note that Maya uses three digits for values listed within its tools and editors. The book may only show one or two digits when the last one or two digits are 0.


Free Autodesk Software for Students and Educators
The Autodesk Education Community is an online resource with more than five million members that enables educators and students to download—for free (see website for terms and conditions)—the same software used by professionals worldwide. You can also access additional tools and materials to help you design, visualize, and simulate ideas. Connect with other learners to stay current with the latest industry trends and get the most out of your designs. Get started today at www.autodesk.com/joinedu.

How to Contact the Author

You can contact author Todd Palamar with questions, comments, or concerns through his website at www.speffects.com, where you can see other books and productions on which he has worked.

Sybex strives to keep you supplied with the latest tools and information you need for your work. Please check this book’s website at www.sybex.com/go/masteringmaya2014, where we’ll post additional content and updates that supplement this book should the need arise.

Chapter 1

Working in Autodesk Maya

The Autodesk® Maya® 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 allow you to bring your fantastic creations to life easily.

Understanding the way Maya organizes data about the objects, animations, textures, lights, dynamics, and all the other elements contained within the 3D environment of a scene is essential to understanding how the interface is organized. Maya uses what’s known as the Dependency Graph to keep track of the various packets of data, known as nodes, and how they affect each other. Any single element of a Maya scene consists of multiple nodes connected in a web, and each one of these nodes is dependent on another. The Maya interface consists of editing windows that allow you to connect these nodes in an intuitive way and edit the information contained within each node.

There is usually more than one way to accomplish a task in Maya. As you grow comfortable with the interface, you’ll discover which editing windows best suit your working style.

This chapter is a brief overview of what professionals need to understand when working in Maya. You’ll learn what types of nodes you’ll be working with and how they can be created and edited in Maya. You’ll also learn how to work with projects and scene data as well as the various windows, panels, and controls that make up the interface. This will help you, whether you are working alone or as part of a team of artists.

This chapter is about working with nodes, but it is not meant to be a comprehensive guide to each and every control in Maya. You will find that information in the Maya documentation. If you’ve never used Maya before, I strongly encourage you to read the Maya documentation as well as Introducing Autodesk Maya 2013, by Dariush Derakhshani (Sybex, 2012).

In this chapter, you will learn to:

  • Understand transform and shape nodes
  • Create a project
  • Use assets
  • Create file references

Creating and Editing Nodes

A Maya scene is a system of interconnected nodes that are packets of data. The data within a node tells the software what exists within the world of a Maya scene. The nodes are the building blocks that 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 their 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 (DG), 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. There are usually many ways to get to your destination, and some of them make more sense than others depending on where you’re going. In Maya, the best workflow depends on what you’re trying to achieve, and there is typically more than one possible ideal workflow.

There are many types of nodes in Maya that serve any number of different functions. All the nodes in Maya are considered DG nodes. Let’s say you have a simple cube and you subdivide it once, thus quadrupling the number of faces that make up the cube. The information concerning how the cube has been subdivided is contained within a DG node that is connected to the cube node.

A special type of DG node is the directed acyclic graph (DAG) node. These nodes are made of two specific types of connected nodes: transform and shape. The arrangement of DAG nodes consists of a hierarchy in which the shape node is a child of the transform node. Most of the objects you work with in the Maya viewport, such as surface geometry (cubes, spheres, planes, and so on), are DAG nodes.

To understand the difference between the transform and shape node types, think of a transform node as describing where an object is located and a shape node as describing what an object is.

The simple polygon cube in Figure 1-1 consists of six flat squares attached at the edges to form a box. Each side of the cube is subdivided twice, creating four polygons per side. That basically describes what the object is, and the description of the object would be contained in the shape node. This simple polygon cube may be 4.174018 centimeters above the grid, rotated 35 degrees on the x-axis, and scaled four times its original size based on the cube’s local x- and y-axes and six times its original size in the cube’s local z-axis. That description would be in the transform node.

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.

Figure 1-1 A shape node describes the shape of an object and how it has been constructed; a transform node describes where the object is located in the scene.

c01f001.tif

Using the Hypergraph

The Hypergraph is a picture of the nodes and their connections in Maya. A complex scene can look like an intricate web of these connections. When you need to know how a network of nodes is connected, the Hypergraph gives you the most detailed view. There are two ways to view the Hypergraph:

  • The hierarchy view shows the relationships between nodes as a tree structure.
  • The connections view shows how the nodes are connected as a web.

You can have more than one Hypergraph window open at the same time, but you are still looking at the same scene with the same nodes and connections.

This short exercise gives you a sense of how you would typically use the Hypergraph:

1. Create a new Maya scene.
2. Create a polygon cube by choosing Create ⇒ Polygon Primitives ⇒ Cube.
3. You will be prompted to draw a polygon on the grid by dragging on the grid (see Figure 1-2). Drag a square on the grid, release the cursor, and then drag upward on the square to turn it into a three-dimensional cube. Release the mouse button to complete the cube. At this point, feel free to make your own decisions about the size and position of the cube on the grid.

Figure 1-2 Maya prompts you to draw the base of the cube on the grid in the scene.

c01f002.tif
4. Select the cube in the viewport, and choose Window ⇒ Hypergraph: Hierarchy to open the Hypergraph in hierarchy mode. You’ll see a yellow rectangle on a black field labeled pCube1. The rectangle turns gray when deselected.

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. This feature is turned off for all the projects in this book to ensure precise placement of primitive objects.
While the Interactive Creation mode is on, you can deselect the Exit On Completion method; this means that each time you draw on the grid, you will continue to create cubes until you switch to another tool.

5. Move the mouse over the rectangle labeled pCube and then right-click. Choose Rename from the pop-up window. Rename the cube myCube.
6. Select myCube and, from the Hypergraph menu, choose Graph ⇒ Input And Output Connections. This switches the view to the connections view just as if you had originally opened the Hypergraph by choosing Window ⇒ Hypergraph: Connections. It’s the same Hypergraph, but the view mode has changed, allowing you to see more of the scene.

When you graph the input and output connections, you see the connected nodes that make up an object and how the object appears in the scene. In the current view, you should see the myCube node next to a stack of connected nodes labeled polyCube1, myCubeShape, and initialShadingGroup, as shown in Figure 1-3. (The nodes may also be arranged in a line; the actual position of the nodes in the Hypergraph does not affect the nodes themselves.)


Navigating the Hypergraph
You can navigate the Hypergraph by using the same hot-key combination you use in the viewport: Alt+MMB-drag/Option+MMB-drag pans through the Hypergraph workspace, and Alt+RMB-drag/Option+RMB-drag zooms in and out. (MMB means clicking with the middle mouse button, and RMB means clicking with the right mouse button.) Selecting a node and pressing the f hot key focuses the view on the currently selected node. It is also possible to zoom in using the scroll wheel on your mouse.

Figure 1-3 The node network appears in the Hypergraph. This shape node (myCubeShape) is connected to two other nodes, whereas the transform node (myCube) appears off to the side.

c01f003.tif

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. The polyCube1 node is the construction history node for the myCubeShape node. When you first create a piece of geometry, you can set options to the number of subdivisions, spans, width, height, depth, and many other features that are stored as a record in this history node. Additional history nodes are added as you make changes to the node. You can go back and change these settings as long as the history node still exists. Deleting a history node makes all the previous changes to the node permanent (however, deleting history is undoable). Use the following steps to guide you through the process of modifying history nodes:

1. Keep the Hypergraph open, but select the cube in the viewport.
2. Change the menu set in the upper left of the main interface to Polygons.
3. Press the 5 key on the keyboard to switch to shaded mode. Choose Mesh ⇒ Smooth. The cube will be subdivided and smoothed in the viewport.
In the Hypergraph you’ll see a new polySmoothFace1 node between the polyCube1 node and the myCubeShape node (see Figure 1-4). This new node is part of the history of the cube.
4. Select the polySmoothFace1 node, and delete it by pressing the Backspace key on the keyboard. The cube will return to its unsmoothed state.

Figure 1-4 Performing a smooth operation on the cube when construction history is activated causes a new polySmoothFace1 node to be inserted into the node network.

c01f004.tif
5. Select the transform node (myCube), and press the s hot key. This creates a keyframe on all the channels of the transform node. A keyframe stores the current attribute values at a particular time on the timeline. Animation is created by interpolating between keyframed values.
You’ll see a new node icon appear for each keyframed channel with a connection to the transform node (see Figure 1-5).

Figure 1-5 The attributes of myCube’s transform node have been keyframed. The keyframe nodes appear in the Hypergraph.

c01f005.tif
6. Hold the cursor over any line that connects one node to another. A label appears describing the output and input attributes indicated by the connection line.

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 delete history periodically 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. Once you start animating a scene using deformers and joints, you can use the Delete By Type ⇒ Non-Deformer History option, which will remove the construction history nodes while preserving connections to animation nodes such as deformers.
You can turn off the history globally by clicking the Construction History toggle switch on the status line, as shown here.
c01uf001.tif

Connecting Nodes with the Node Editor

Connections between nodes can be added, deleted, or changed using the Hypergraph and the Connection Editor. Introduced in Maya 2013, the Node Editor combines the features of the Hypergraph, Hypershade, and Connection Editor into a single graphical interface. Maya 2014 brings numerous changes and enhancements.

When you open the Node Editor you are presented with an empty, grid lined space. The upper left corner displays various stats about the current state of the Node Editor—for instance, how nodes or connections are currently being shown. In order to view a selected node, you must choose the type of connections you wish to graph: input, output, or both. After establishing a graph, you can add additional nodes by choosing the blue plus symbol from the Node Editor toolbar.

Every node has a series of ports for connecting attributes between nodes. By default, the nodes are shown in Simple mode, meaning none of their attributes or other ports are shown. In Simple mode, you can click on the dot on either side of the node to access a pop-up menu for a node’s input or output connections. When unconnected, the superport is a white. After connecting, the port takes on the color of the connected attribute. You do not always have to use the superport and subsequent pop-up menu to make connections. You can expose the lesser ports by changing the nodes display from their simple, default display to Connected, exposing the connected attributes, and Full. Click the icon in the lower-right corner of each node to change its display. You can also press 1, 2, or 3 on the keyboard, with the node selected, to change its mode. To change all of the node’s modes at once use the Edit menu at the top left of the Node Editor. The Full mode allows you to see all of the connectable ports (see Figure 1-6).

Figure 1-6 The various display modes, starting with locator1 in default, nurbsSphere1 in full and locator2 in Connected mode.

c01f006.tif

Like with all editors in Maya, you can customize the colors of the Node Editor using the Windows ⇒ Settings/Preferences ⇒ Color Settings window. The Attribute Type rollout under the Node Editor rollout allows you to change the color of the various types of connections.

The following steps walk you through the basic usages of the Node Editor and how to make connections:

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. Press the w hot key to switch to the Move tool; select the locator at the center of the grid, and move it out of the way.
4. Press the g hot key to create another locator. The g hot key repeats the last action you performed, in this case the creation of the locator.
5. Create a NURBS sphere in the viewport by choosing Create ⇒ NURBS Primitives ⇒ Sphere. If you have Interactive Creation selected, you’ll be prompted to drag on the grid in the viewport to create the sphere; otherwise, the sphere will be created at the center of the grid based on its default settings.
6. Move the sphere away from the center of the grid so that you can clearly see both locators and the sphere.
7. Use the Select tool (hot key = q) to drag a selection marquee around all three objects.
8. Open the Node Editor by choosing Window ⇒ Node Editor. A grid is drawn in the workspace. The grid can be toggled on or off by choosing the grid-visibility button (circled in Figure 1-7) from the Node Editor’s toolbar. Choose the Input and Output Connections button, circled in Figure 1-7, to graph your selection.

Figure 1-7 The input and output connections of the two locators and the sphere are graphed in the Node Editor.

c01f007.eps
At the bottom of the screen are the two transform nodes for locator1 and locator2. locatorShape1 and locatorShape2 are the 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 makeNurbSphere1, which is the history node, and to initialShadingGroup. The initialShadingGroup node is the default shading group that is applied to all geometry; without this node, the geometry can’t be shaded or rendered. When you apply a new shader to an object, the connection to initialShadingGroup is replaced with a connection to the new shader. A shader is a node that determines how a surface appears in Maya, as well as how it reacts to virtual lights.
9. In the Node Editor, use Alt+RMB to zoom in and out. Notice how the name bar that sits on top of each node scales with the camera, enabling you to view long names regardless of your camera view.
10. Select the locator1, locator2, and nurbsSphere1 transform nodes, and drag them away from the other nodes so that you can work on them in their own space. To keep your graph neat, you can use snap to grid to align your nodes with the grid.
11. Click the white superport on the right side of the locator1 node. This is the output.
12. From the pop-up menu, choose Translate ⇒ Translate. A yellow wire extends from the translate node (see Figure 1-8). The wire can be connected to a white port on another node.
13. Connect the yellow wire to the left side of the nurbsSphere1 node by clicking on its white superport and choosing Translate from the pop-up menu. You can connect the yellow wire to either side of a node. The connection will be the same. A green wire shows the finished connection.

Figure 1-8 Use the wire to connect the output of one node to the input of another.

c01f008.tif
You can also choose Other from the pop-up menu. Doing so brings up the Input Selection window. The window lists the attributes of the node. Any of the attributes that have a plus sign next to them can be expanded to reveal nested attributes. For instance, find the Translate attribute and expand it by clicking the plus sign. (The term translate in Maya refers to an object’s position. When you use the Move tool to change the position of an object in 3D space, you are “translating” the object.) You’ll see that Translate has TranslateX, TranslateY, and TranslateZ. This means that you can choose either to select the Translate attribute, which will automatically use all three nested attributes as the input connection, or to expand Translate and choose one or more of the nested TranslateX, Y, or Z attributes as the input connection. In some situations, a connection becomes unavailable (grayed out), indicating that the connection between the two attributes cannot be made, usually because the connection is not appropriate for the selected attributes (see Figure 1-9).
14. In the viewport, switch to wireframe mode if you are not already in it. You can do this by pressing 4 on the keyboard or by clicking the wireframe icon on the icon bar at the top of the viewport window; the wireframe icon is the wireframe cube.
15. In the viewport, you’ll notice that the sphere has snapped to the same position as the locator. Select the sphere, and try to move it using the Move tool (hot key = w). The sphere is locked to the locator, so it cannot be moved. Select the locator, and try to move it; the sphere moves with the locator. The output of the locator’s Translate attributes are the input for the sphere’s Translate.

Figure 1-9 The Input Selection window specifies which attributes can be connected between nodes.

c01f009.tif

Incoming Connections
In wireframe view, an object will be highlighted in purple if it has an incoming connection from the selected object.

16. Click on the nurbsSphere1 node and press 3 to display the node's attributes in full. Click on the plus sign next to Rotate to expand the rotate rollout. Repeat the procedure for locator2.
17. Click on the the right-side port or output for RotateX on nurbsSphere1.
18. Drag the yellow wire to the left side (the input side) of locator2 and connect it to RotateY. The yellow wire turns cyan to match the color of its port of origin and the connection is made. The difference in color indicates rotational values as opposed to numeric values, like those used by the translate and scale attributes.
19. In the viewport, select the sphere and switch to the Rotate tool (hot key = e).
20. Drag up and down on the red circle of the tool to rotate the sphere around its x-axis. The locator rotates around its y-axis.

Using the Node Editor to Make Simple Connections
The Node Editor is perfect for making one-to-one relationships between attributes on two nodes. In other words, the value of the output connection needs to equal exactly the value of the input connection. You can also create nodes from inside the editor by using the RMB and subsequent marking menu.

The Node Editor can get cluttered quickly. To combat a messy graph, you can pin your nodes to their current position and size regardless of regraphing. The pushpin icon in the upper-left quadrant of the node (top-right corner on Mac) allows you to toggle the pinning feature. You can also select Options ⇒ Pin All Nodes By Default or RMB in the Node Editor to access the option through the marking menu.

Experiment with making connections between the various attributes with the Node Editor. You can break a connection by selecting and dragging the arrow along the wire into empty space. Notice the changes in the port colors when making or breaking connections.

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. It is another way to view the transform and shape nodes in a scene and a way to create hierarchical relationships between nodes through parenting. The Outliner does not show the connections between nodes like the Hypergraph does; rather, it shows the hierarchy of the nodes in the scene. To see how this works, try the following exercise:

1. Open miniGun_v01.ma from the Chapter1/scenes directory at the book’s web page (www.sybex.com/go/masteringmaya2014). The scene consists of a minigun model in three parts.
2. Open the Outliner by choosing Window ⇒ Outliner.

Outliner Layout Presets
The Outliner can be opened as a separate panel or, like many of the panels in Maya, it 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. You can also click the third layout button on the left side of the interface just below the toolbox (as shown here).
c01uf002.tif

3. At the top of the Outliner is a menu bar. In the Display menu, make sure DAG Objects Only is selected and Shapes is deselected (see Figure 1-10).

Figure 1-10 The Display menu at the top of the Outliner

c01f010.tif
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. Rotate the objects; nothing else is affected. Try translating housing using the Move tool (hot key = w); again, nothing else is affected.
6. Use Undo (hot key = Ctrl/Cmd+z) a few times until the housing node returns to its original location and orientation.
7. In the Outliner, select the gunBarrels object. Then Ctrl/Cmd+click the housing object, and choose Edit ⇒ Parent (hot key = p) from the main Maya menu at the top.
Parenting one object to another means that 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. When you have multiple objects selected, the last object selected becomes the parent. In the Outliner, you’ll notice that the housing node has a plus sign beside it and the gunBarrels node is not visible. The plus sign indicates that the node has a child node.
8. Click the plus sign next to the housing node to expand this two-node hierarchy. The gunBarrels node is now visible as the child of the housing node.
9. Select the housing node, and try rotating and translating it. The gunBarrels node follows the rotation and translation of the housing node (see Figure 1-11).
Unlike the situation presented in the “Connecting Nodes with the Node Editor” section earlier in this chapter, the rotation and translation of the gunBarrels object are not locked to the rotation and translation of the housing node; rather, as a child, its rotation, translation, scale, and visibility are all relative to that of its parent.

Figure 1-11 When the gunBarrels node is made a child of the housing object, it inherits changes made to the housing object’s transform node.

c01f011.tif