Maya’s Architecture

If you are a race car driver, you may not be expected to know how to build a car from scratch, but you should at least have a good understanding of how your car works. Knowing how the gearbox works will help you shift gears more efficiently while you are racing. A Maya user should approach Maya in the same way.

The Maya user interface is designed so that it is possible for someone to use it to complete a project without knowing much about what’s going on “under the hood.” However, to harness its power and work more efficiently, you should understand the basics of how Maya works.

Maya’s documentation describes a Maya scene as “a collection of nodes with attributes that are connected.” But what does this mean, exactly?

Nodes, Attributes, and Dependencies

A node is the basic building block for anything in Maya. There are many different types, including shape nodes, transform nodes, rendering nodes, and nodes that contain algorithms for certain operations. Every node contains attributes, or channels, that are specific to that particular node. Attributes are the properties of the nodes.

Color is an example of an attribute on a material node. An attribute’s input and output can be connected to the input and output of an attribute on another node. When an attribute’s input is controlled by another attribute, we say that it is dependant on the incoming connection.

To understand this better, let’s look at what nodes make up a NURBS sphere and what attributes are connected. Any object in Maya, be it a piece of geometry, a texture map, a light, or even an operation, can be defined in one or a group of nodes.

Figure below shows the nodes that make up a primitive NURBS sphere in Maya, as displayed in Maya’s Hypergraph.

The Hypergraph window shows a graphical representation of the relationship between objects in a scene. In Figure above, the Hypergraph is displaying the input and output connections’ attributes, or dependencies, between the nodes that are used to build this sphere.

Although this might not make much sense to you now, you’ll learn more about using Hypergraph in almost all of the chapters in this book. For now, you should know that the lines that appear between nodes show that the attributes of the nodes are connected, and the arrows show the direction of these connections.

In other words, in this example, Maya handles the information contained in the first node, makeNurbSphere1, and outputs that information through an attribute that is connected to an input attribute on the next node, nurbsSphereShape1.

It then moves to the initialShadingGroup node and processes the attributes contained within it to display the final shape on your computer screen. All the information about the sphere’s size, sweep angle (where it begins and ends), and resolution is stored in unique attributes as some value inside the makeNurbSphere1 node.

The values for these attributes can contain different data types: an integer (a whole number), a float (a decimal), a Boolean (on or off), or a string (text). You as the user can edit the values for the attributes on this node by selecting the node in the Hypergraph and modifying its attributes in the Attribute Editor or Channel Box.

Maya takes all of the information from this makeNurbSphere1 node and sends it out from the Output Surface attribute. This Output Surface attribute feeds into the nurbsSphereShape1 node’s Create attribute.

The nurbsSphereShape1 node contains attributes that deal mostly with how the rendering engine will interpret this shape at render time. For example, the shape node contains attributes that determine whether the object will cast a shadow, receive a shadow, cast a reflection, or will even be rendered at all.

Now that Maya knows what the shape is, it needs to know how the object will shade so that it can render it properly. The initialShadingGroup node takes the output from the shape node and the output from the material node to decide the surface properties for this sphere.

It then outputs that information, along with any other information based on its own attributes, and feeds the sphere into the render partition—where the information from the shading group and the lights are calculated together for the renderer to do its job. (The renderPartition node is not displayed in Figure above.)

Since the nurbsSphereShape1 node is dependant on the makeNurbSphere1 node, we say that the shape has history. You can delete the history of any object by selecting it and choosing Edit | Delete By Type | History. This will break the connections to all incoming nodes and delete them.

In this case, once the history is deleted on the shape node, we can no longer go back and edit its sweep angle or resolution. If we wanted to do this, we would need to perform an additional operation that would introduce another node and connect it to the shape node.

Node Hierarchies

If you refer back to Figure above, you’ll see a node named nurbsSphere1 that does not display any lines connecting it to the other nodes in the sphere’s network. This is a transform node. A transform node contains attributes whose values determine the translation (position), rotation, scale, and visibility of the objects connected to it.

The reason that the connections are displayed differently for this node is that none of the attributes from any of the other nodes shown in the Hypergraph are connected to the transform node. Instead, they share a different type of relationship, called a hierarchical relationship.

When you work with 3D modeling and animation, you often use a hierarchy to create relationships among objects. For example, to have multiple objects follow one object’s movement, you need to create a hierarchical relationship. Say you’re working with a car object.

You want to be able to select the car’s body and have the wheels, doors, trunk, and hood all move with it. The car body object, in this case, would be the parent object, and the other objects would be the children of the car body. The way children follow a parent is called hierarchical transformation.

This hierarchical concept is useful while grouping many objects into one model or for animating several objects efficiently. The structure of a hierarchy is known as a tree, because of its resemblance to that natural phenomenon— except it’s upside down.

The top, or base level, of the hierarchy is called the root, while the objects below the root hierarchy are called the branches. Sometimes you’ll see the terms parent and child used to describe the hierarchy. Basically, the parent is the root, and the children are the branches.