The Maya Dependency Graph

The rest of this page describes the older pre-Maya 2016 evaluation model with dirty propagation.

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.

comments powered by Disqus