pymel.core.system.dgInfo

dgInfo(*args, **kwargs)

This command prints information about the DG in plain text. The scope of the information printed is the entire graph if the allflag is used, the nodes/plugs on the command line if they were specified, and the selection list, in that order. Each plug on a connection will have two pieces of state information displayed together at the end of the line on which they are printed. There are two possible values for each of the two states displayed. The values are updated when the DG pulls data across them, usually through evaluation, or pushes a dirty message through them. There are some subtleties in how the data is pulled through the connection but for simplicity it will be referred to as evaluation. The values displayed will be CLEAN or DIRTY followed by PROP or BLOCK. The first keyword has these meanings: CLEANmeans that evaluation of the plug’s connection succeeded and no dirty messages have come through it since then. It also implies that the destination end of the connection has received the value from the source end. DIRTYmeans that a dirty message has passed through the plug’s connection since the last time an evaluation was made on the destination side of that connection. Note: the data on the node has its own dirty state that depends on other factors so having a clean connection doesn’t necessarily mean the plug’s data is clean, and vice versa. The second keyword has these meanings: PROPmeans that the connection will allow dirty messages to pass through and forwards them to all destinations. BLOCKmeans that a dirty message will stop at this connection and not continue on to any destinations. This is an optimization that prevents excessive dirty flag propagation when many values are changing, for example, a frame change in an animated sequece. The combination CLEAN BLOCKshould never be seen in a valid DG. This indicates that while the plug connection has been evaluated since the last dirty message it will not propagate any new dirty messages coming in to it. That in turn means downstream nodes will not be notified that the graph is changing and they will not evaluate properly. Recovering from this invalid state requires entering the command dgdirty -ato mark everything dirty and restart proper evaluation. Think of this command as the reset/reboot of the DG world. Both state types behave differently depending on your connection type. SimpleA -B: Plugs at both ends of the connection share the same state information. The state information updates when an evaluation request comes to A from B, or a dirty message is sent from A to B. Fan-OutA -B, A -C: Each of A, B, and C have their own unique state information. B and C behave as described above. A has its state information linked to B and C - it will have CLEANonly when both B and C have CLEAN, it will have BLOCKonly when both B and C have BLOCK. In-OutA -B, C -A: Each of A, B, and C have their own unique state information. B and C behave as described above. A has its state information linked to B and C. The CLEAN|DIRTYflag looks backwards, then forwards: if( C == CLEAN ) A = CLEAN else if( B == CLEAN ) A = CLEAN The BLOCKstate is set when a dirty message passes through A, and the PROPstate is set either when A is set clean or an evaluation passes through A. There are some other exceptions to these rules: All of this state change information only applies to dirty messages and evaluations that use the normal context. Any changes in other contexts, for example, through the getAttr -t TIMEcommand, does not affect the state in the connections. Param curves and other passive inputs, for example blend nodes coming from param curves, will not disable propagation. Doing so would make the keyframing workflow impossible. Certain messages can choose to completely ignore the connection state information. For example when a node’s state attribute changes a connection may change to a blocking one so the message has to be propagated at least one step further to all of its destinations. This way they can update their information. Certain operations can globally disable the use of the propagaton state to reduce message flow. The simplest example is when the evaluation manager is building its graph. It has to visit all nodes so the propagation cannot be blocked. The messaging system has safeguards against cyclic messages flowing through connections but sometimes a message bypasses the connection completely and goes directly to the node. DAG parents do this to send messages to their children. So despite connections into a node all having the BLOCKstate it could still receive dirty messages.

Flags:

Long Name / Short Name Argument Types Properties
allNodes / all bool ../../../_images/create.gif
  Use the entire graph as the context
connections / c bool ../../../_images/create.gif
  Print the connection information
dirty / d bool ../../../_images/create.gif
  Only print dirty/clean nodes/plugs/connections. Default is both
nodes / n bool ../../../_images/create.gif
  Print the specified nodes (or the entire graph if -all is used)
nonDeletable / nd bool ../../../_images/create.gif
  Include non-deletable nodes as well (normally not of interest)
outputFile / of unicode ../../../_images/create.gif
  Send the output to the file FILE instead of STDERR
propagation / p bool ../../../_images/create.gif
  Only print propagating/not propagating nodes/plugs/connections. Default is both.
short / s bool ../../../_images/create.gif
  Print using short format instead of long
size / sz bool ../../../_images/create.gif
  Show datablock sizes for all specified nodes. Return value is tuple of all selected nodes (NumberOfNodes, NumberOfDatablocks, TotalDatablockMemory)
subgraph / sub bool ../../../_images/create.gif
  Print the subgraph affected by the node or plugs (or all nodes in the graph grouped in subgraphs if -all is used)
type / nt unicode ../../../_images/create.gif
  Filter output to only show nodes of type NODETYPE Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.dgInfo

Example:

import pymel.core as pm

# create a node
pm.createNode('transform',name='NODE')
# Result: nt.Transform(u'NODE') #
pm.setKeyframe('NODE.translate')
# Result: 3 #
# Print all things connected to node NODE
pm.dgInfo( 'NODE', c=True )
# Print all connections currently in the graph
pm.dgInfo( c=True, all=True )
# Print the datablock size of all nodes currently in the graph
pm.dgInfo( sz=True, all=True )
# Result: [281, 281, 38264] #
# Return: [12, 12, 12314]
# Print all connections to attribute tx on node NODE
pm.dgInfo('NODE.tx',c=True)
# Print all dirty connections in the entire graph
pm.dgInfo( c=True, all=True, d=True )