The Maya Dependency Graph

When writing most Maya plug-ins, knowledge of the Maya Dependency Graph architecture is necessary.  Explanations of the Maya DG can be found in most Maya books and the documentation.  It is basically a node network that passes information from one node to the next.  The most important aspects for a developer to know about the DG are how and when Maya recalculates and propagates data through the graph.

Nodes have a set of inputs and outputs.  The outputs depend on the values of the inputs.  These outputs are said to be dependents of their corresponding inputs and the inputs are said to affect the corresponding outputs.   As an optimization, Maya’s DG is designed to only calculate data when it needs to.  It accomplishes this with a dirty flag on a node’s inputs and outputs.  When an input value is changed, any dependent output is marked dirty.  The output is not actually recalculated.  Any connection to this output is marked dirty and the dirty propagation continues until the end of the graph is reached.  No data recalculation has occurred yet; only the dirty flag has been pushed through the DG.  When Maya requests a DG reevaluation, such as in a screen refresh, Maya will check if a node output is dirty.  If it is, Maya tells the node to evaluate itself.   When that node evaluates, it sees that its inputs are dirty and so asks any connected input node to reevaluate.  This process occurs until the data in the graph is reevaluated and the inputs and outputs are marked clean.

This knowledge is useful when trying to figure out why your node is not being computed.  If a node is not being computed, its outputs are not being requested.

Since descriptions of the Maya DG architecture are already discussed in depth else where, I will not reproduce it here.  I recommend reading more about Maya’s dependency graph architecture in the documentation and in various other Maya books and white papers.

2 thoughts on “The Maya Dependency Graph”

Ejike Okorie October 8, 2011 at 5:34 pm

I wouldn’t size to be grateful on your effort to seeing that average ones would have a comprehensive knowledge on Maya.. Please, I Would be grateful if I would be recieving ebooks on Maya. Thanks for your understanding.

Pingback: Verajankorva

Leave A Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

<code> For inline code.
[sourcecode] For multiline code.