Monday, January 10, 2011

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. When you really need to know how a network of nodes isconnected, the Hypergraph gives you the most detailed view. There are two ways to view the Hypergraph, the hierarchy view and the connections view:

  • 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 Primitive s> Cube. 
  3. You will be prompted to draw a polygon on the grid by dragging on the surface. Drag a square on the grid, release the cursor, and then drag upward on the square to turn it into a three-dimensional cube (see Figure 1.2). 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.
  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 feld labeled pCube1. The rectangle turns gray when deselected.



Figure 1.2
When Interactive Creation is on, Maya prompts you to draw the object on the grid in the scene.


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. 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.  Hold the right mouse button down, and hover the cursor over the pCube rectangle. Choose Rename from 
     the pop-up window. Rename the cube myCube.
6.  Select myCube, and choose, from the Hypergraph menu, Graph > Input And Output connections. This 
     switches the view to the connections view just as if you had originally opened the Hypergraph by choosing 
    Windows >  Hypergraph:Connections. It’s the same Hypergraph, but the view mode has changed, 
    allowing you to see more of the scene.


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

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 initial-ShadingGroup, 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.)




Figure 1.3
The node net-work appears in the Hypergraph. This shape node (myCubeShape) is connected to two other nodes, while the transform node (myCube) appears off to the side.

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 frst 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).

  1. Keep the Hypergraph open, but select the cube in the viewport. 
  2. Set the current menu to Polygons (you can change the menu set by choosing Polygons from the menu in the upper left of the Maya interface).
  3. 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 key-
    board. 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 polySmoothFace node to be inserted into the node  network.


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. Once you start animating a scene using deformers and joints, you should not delete the history or use the Delete By Type > Non-Deformer History option.

       5.  Select the transform node (myCube), and press the s hot key. This creates a keyframe on all the 
            channels of the transform node. You’ll see a new node icon appear for each keyframed channel with 
            a connection to the transform node (see Figure 1.5).
       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


Figure 1.5
The attributes of myCube’s trans-form node have been keyframed. The keyframe nodes appear in the Hypergraph.


By Eric Keller with Todd Palamar and Anthony Honn
Copyright © 2010 by Wiley Publishing, Inc., Indianapolis, Indiana

0 comments:

Post a Comment

 
Powered by Blogger