Lesson 06 The Dependency Graph

Posted on Posted in AutoDesk Maya, Foundation 2008

Maya Architecture

Defined by a node based system, known as a dependency graph. Nodes with attributes connected to them

Hierarchies and Dependencies

  1. Set up your view panels to 2 Panes Side by side
    • STAGE || Panels > Layouts > 2 Panes Side by Side
    • – Perspective in the first view. Hypergraph in the second.
      • STAGE || Panels > Panel > Hypergraph Panel > Hypergraph:Hierarchy
    • – Dolly IN your perspective view to display the stage.
  2. Create a primitive(NURBS) sphere
    • – Select MAIN || Create > NURBS Primitives > Sphere
    • – Press 5 to turn on smooth shading
  3. View the shape node
    • – In the Hypergraph Panel, you are currentl looking at the scene view which is focused on transform nodes. This node lets you set the position and orientation of objects.
    • – Only a nurbsSphere is visible in the Hypergraph panel. There are actually two, because the second is hidden by default. The hidden node is the shape node. This node contains info on the node itself.
    • -Display the shape node:  HYPERGRAPH PANEL || Options > Display > Shape node
    • – Now you can see the transform node, which is the positioning node and the shape node which contains info about the surface of the sphere. The shape node defines the position of the shape.
    • – Turn off the shape nodes: Hypergraph Panel || Options > Display > Shape nodes
    • – Notice that when the transform and shape nodes are apart they have different icons. But when the shape node is hidden, the transform node take on the shape node’s icon to help you understand what’s going on underneath.
    • ex:
  4. View the Dependencies
    • To view the dependencies that exist with a primitive sphere you need to take a look at the up and downstream connections.
    • – View Dependencies: Hypergraph Panel || Graph > Input and Output Connections
      • -The original transform node is separated from the shape node. The transform node has a hierarchical relationship to the shape node but the attributes are not dependent on each other.
      • – the node makeNurbSphere is a result of the creation of the sphere. The options set for the sphere are placed into a node that feeds into the shape node.
      • – The shape node is dependent on the input node. Changing values in the input node will affect the sphere.
      • – The initialShadingGroup connected to the sphere is default grey because of the default Lambert that is applied to new objects.
  5. Edit attributes in the Channel Box
    • – you can edit the attributes of nodes in the Channel Window. This allows you to affect both  hierarchical relationships and dependencies
    • ex: If you edit the attributes for the makeNurbSphere node the the shape will be affected.Click on makenurbSphere node(input node) and modify the attributes that populate in the Channel Window to see the effects.
    • – If you change change the attribute to nurbSphere transform node then the position will be altered. Click on nurbSphere1(shape node) and modify the attributes that populate in the Channel Window to see the effects.
    • – For the transform node: Rotate Y: 45
    • – For makeNurbSphere input node: Radius: 3

Shading Groups Nodes

  1. Create a shading network
    • MAIN || Window > Rendering Editors > Hypershade
    • Hypershade Window || Create > Materials > Phong
    • – Assign the material to the sphere
    • – Select the sphere and click on the Input and Output Connections button
    • – Select  the nurbsSphere1 and the phong1SG node in the Hypergraph.
    • – click on the Input and Output Connections button
  2. Open the Attribute Editor
    • – Click on the Scene Hierarchy button in the Hypergraph Panel
    • – Select the sphere’s transform node
    • – Press CTRL + A to bring up the Attribute Editor
    • – In this tab you will see all the tabs that represent parts of the selected node’s Dependency Graph
    • – Attribute Editor lets you focus on one part of the dependency graph at a time.


Making Connections in the Connection Editor

  • To understand a dependency Graph connection, you are going to make your own connection and see how it affects the graph.
  1. Open the Connection Editor
    • – Select the sphere
    • MAIN || General Editors > Connection Editor
    • – Click Reload Left
    • Note: There are more attributes you see here than in the Channel Box
  2. Add a Phong as the Input Node
    • – In the Hypergraph, select the phong1 material node
    • – In the Connection Editor, click on Reload Right
  3. Make Connections
    • You will now connect some attributes from the transform node to the material node
    • – In the left column, scroll down until you find the transform attributes
    • – Click on the (+) sign to expand this muliple attribute and see Translate X, Y, Z attributes
    • – In the right column, find the Color attribute
    • – Click on the (+) sign to expand this multiple attribute and see the Color > R/G/B.
    • – Click on Translate X in the left column
    • – Click on Color R in the right column
    • – Continue with these connections:
      • Translate Y  to Color G
      • Translate Z to Color B
  4. View the Connections
    • – In the Hypergraph panel select phong1 node and click on Input and Output Connections button.
    • – Move the cursor over the connection between the transform node and the material node.
  5. Move the Sphere
    • – Select the sphere and move it along the three axis to see the color changing effect caused by our connections in the connection editor.

Adding  a Texture Node

Map a texture node in replace of the color node.

  1.  Delete Connections
    • Hypergraph Window || Select one of the arrows between the transform node and material node.
    • – Press delete.
    • – Repeat for the other connections
  2. Add a checkered texture map
    • – Click on the phong1 material node in the Hypershade.
    • – Press CTRL+A to toggle to the Attribute Editor
    • – Click on the Map button next to Color.
    • – Select Checker texture from the Create Render Node window.
    • – MMB in the perspective view and press 6 to activate your changes.
    • – The texture is built using 2 nodes:
      • the checker node: contains texture attributes
      • placement node: attributes that define placement of the texture on assigned surfaces.

Animating the sphere

  • Animating changes the value of an attribute over time between 2 keyframes. You can adjust the tangent properties to determine how the value changes in-between keys.
  1. Select the sphere
    • – In the Hypergraph, click on Scene Hierarchy. HYPERGRAPH || Graph> Scene Hierarchy
    • – Select the nurbsSphere transform node
  2. Return the sphere to the origin
    • – Highlight the translate attributes in the Channel Box
    • – Enter a “0” and hit [ENTER]
    • – Set all rotate attribute values to “0”
  3. Animate the sphere’s rotation
    • – In the Time Slider set the playback range to 120 frames
    • – Go to frame 1
    • – Click on Rotate Y attribute name in the Channel Box
    • RMB (on attribute name) > Key Selected
    • This sets a keyframe on frame 1 for the Rotate Y value.
    • Go to frame 120
    • – Change the rotate Y value to 720
    • RMB (on attribute name) > Key Selected
    • – Playback your animation
  4. View the dependencies
    • – Click on the transform nod, nurbsSphere
    • – In the Hypergraph click on the In and Out Connections.
    • Notice the animation curve node connected to the nurbsSphere.
    • – Select the animation curve node and open the Attribute Editor.
    • Notice that all the keyframes were recorded along with the value, time and tangent info.

Procedural Animation

  • Animating attributes at various levels of a Dependency Graph Network.
  1. Create an edit point curve
    • – Hide everything in your scene: MAIN || Display > Hide > All
    • – Select the EP Curve Tool
    • – Press and hold x to turn on grid snap.
    • – Draw a curve similar to the one below.
    • – press [ENTER]
    • MAIN || Modify > Center Pivot
  2. Duplicate the curve
    • – CTRL + D
    • – move the duplicate curve to the other side of the grid.
  3. Create a lofted surface
    • A lofted surface can be created using two or more curves
    • – CLICK + DRAG a selection box around the two curves
    • SURFACES || Surfaces > Loft
  4. Change your display panel to two panels side by side
    • – In one panel show only perspective view with only NURBs Curves:
    • STAGE || Show > None then STAGE || Show > NURBs Curves
    • – In the second window show the perspective view with shading on. Press 6
  5. Edit CVs on the original curves
    • – Select the first curve in the first panel.
    • RMB(over the curve) > Control Vertex
    • – Select one of the CVs and move it down
    • Note the view in the perspective view. Since the lofted surface was dependent on the curve, the transformation was applied to both.

Curve On A Surface

  • Now you’ll build a curve that will become dependent on the shape of the surface for it’s own shape.
  • A surface is built as a grid of surface lines called isoparms. These lines define a separate coordinate system speific to each surface. Where space coordinates are defined by X, Y, Z, surface coordinates are defined by U and V.
  1. Make the surface live
    • – Select the surface
    • – Select MAIN || Modify > Make Live
    • – Turn off the grid. Select MAIN || Display > Grid
  2. Draw a curve on the surface
    • – Select the EP Curve Tool. MAIN || Create > EP Curve Tool
    • – Draw a curve on the live surface
  3. Move the curve on the surface
    • – Press [ENTER] to complete the curve.
    • – With ep curve selected, select the Move Tool. Notice the move tool looks different. Only two manipulator handles. One for U: direction of surface and one for the V direction of the surface.

    CLICK + DRAG on the manipulators to move th curve around the surface. Notice how it conforms to the shape.

  4. Revert live surface
    • – click on an empty space
    • – Select MAIN || Modify > Make Not Live
    • Note: You can also click on the icon Make Live Button


Group Hierarchy

  • Build a hierarchy by grouping two primitives, then animating the group along the curve-on-surface using path animation
  1. Create A Primitive Cone
    • – Select MAIN || Create > NURBS > Primitives > Cone
  2. Create A Primitive Sphere
    • – Select MAIN || Create > NURBS > Primitives > Sphere
    • – Move the sphere over the cone.
  3. Group The Two Objects
    • – Select the cone and sphere.
    • MAIN || Edit > Group OR CTRL + G
    • – Select MAIN || Display > Transform Display > Selection Handles
    • Note: Selection handles make it easier to pick the object in selection mode. They have a higher selection priority than curves and surfaces.


Path Animation

  • Attach the group to the curve on the surface to animate the new group.
  1. Attach the group to the curve on the surface
    • – With group selected, HOLD SHIFT and select curve on surface.
    • – Go to Animation Menu Set
    • ANIMATION || Animate > Motion Paths > Attach to Motion Path > □
      • Attach to Motion Pathwindow
        • Follow: Off
        • – Click [ATTACH]
    • – Playback results
  2. Constrain the Surface Normal; ANIMATION || Constrain > Normal
    • – Click on the surface on it’s own
    • HOLD SHIFT and click on the grouped primitives
    • ANIMATION || Constrain > Normal
      • Aim Vector: 0, 1, 0
      • Up Vector: 1, 0, 0
    • – Click [ADD] to create the constraint
    • – Playback your results
    • Note: The group is now orienting itself based on the normal direction of the surface. The group is dependent on the surface in two ways. 1) position is dependent on the path curve, where the path curve is dependent on the surface for its shape. 2) it’s orientation is directly dependent on the surface’s shape.


Layer the Animation

  • Various parts of the Dependency Graph can be animated. You will animate different nodes within the network to see how the dependencies work.
  1. Edit The Loft Curve Shape
    • Since the shape of the surface is dependent on the original loft curves, you will start by animating the shape of the second curve.
    • – Select the second curve
    • – Click on the RMB (over curve)  > Control Vertex
    • Note: Control vertices define the shape of a curve. By editing these, you are editing the curve’s shape node.
    • – CLICK + DRAG a selection box over one of the CVs and move it to a new position.
    • Note: As you move the CV, the surface updates it’s shape, which in turn redefines the curve-on-surface and the orientation of the group. All the dependencies are being updated.
  2. Set the keys on the CV position
    • – Go to Frame 1
    • – Set a keyframe. Press s
    • – Go to Frame 120
    • – Set a keyframe. Press s
    • – Go to Frame 60.
    • – Move the CV to a new position.
    • – Set a keyframe. Press s
    • – Play back the results
    • Note: You can see how the dependencies are updated as it’s animated. The construction history is animated so don’t delete it.
  3. Animate the Curve-On-Surface
    • Add another layer of animation by keyframing the curve-on-surface
    • – Select the curve-on-surface
    • – Go to Frame 01
    • – Set a keyframe. Press s.
    • – Go to Frame 120
    • – Move the curve-on-surface to another position on the lofted surface
    • – Set a keyframe. Press s.
  4. Assign the Phong Shading Group

    • Assign the checkered shading group to see it better.
    • – Select the primitive group
    • – Go to the Rendering menu set
    • – Select RENDERING || Lighting/shading > Assign Existing Material > Phong1
    • Play back scene.
  5. View the Dependencies
    • – Select the primitive group that is attached to the motion path
    • – Open the Hypergraph and click on Input and Output Connections button.