Go to: Synopsis. Return value. Keywords. Related. Flags. Python examples.

Synopsis

dgdirty([allPlugs=boolean], [clean=boolean], [list=string], [propagation=boolean], [verbose=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

dgdirty is NOT undoable, NOT queryable, and NOT editable.

The dgdirty command is used to force a dependency graph dirty message on a node or plug. Used for debugging to find evaluation problems. If no nodes are specified then the current selection list is used. When the list flag is specified it will return the list of plugs, data, or connections that are currently marked as dirty. Be careful using this option in conjunction with the all flag, the list could be huge.

Return value

string[]List of dirty/clean plugs in list plug mode.
string[]List of plugs with dirty/clean data in list data mode.
string[]Pairs of dirty/clean connected plugs in list connection mode.
intNumber of dirty/clean messages sent out in normal mode.

Keywords

dg, dependency, graph, dirty, plug, state

Related

dbpeek, dgInfo, dgeval

Flags

allPlugs, clean, list, propagation, verbose
Long name (short name) Argument types Properties
allPlugs(a) boolean create
Ignore the selected or specified objects and dirty (or clean) all plugs.
clean(c) boolean create
If this flag is set then the attributes are cleaned. Otherwise they are set to dirty.
list(l) string create
When this flag is specified then instead of sending out dirty/clean messages the list of currently dirty/clean objects will be returned. The allPlugs and clean flags are respected to narrow guide the values to be returned. The value of the flag tells what will be reported.
  • "data" or "d" = show plugs that have dirty/clean data
  • "plug" or "p" = show plugs that have dirty/clean states
  • "connection" or "c" = show plugs with connections that have dirty/clean states
Note that "p" and "c" modes are restricted to plugs that have connections or non-standard state information. Other attributes will not have state information to check, though they will have data. In the case of array attributes only the children that have values currently set will be considered. No attempt will be made to evaluate them in order to update the available child lists. e.g. if you have a DAG with transform T1 and shape S1 the instanced attribute S1.wm[0] will be reported. If in a script you create a second instance T2->S1 and immediately list the plugs again before evaluation you will still only see S1.wm[0]. The new S1.wm[1] won't be reported until it is created through an evaluation, usually caused by refresh, a specific getAttr command, or an editor update. Note that the list is only for selected nodes. Unlike when dirty messages are sent this does not travel downstream.
propagation(p) boolean create
If this flag is set then the ability of dirty messages to flow through the graph is left enabled. Otherwise the dirty states are set and further message propagation is blocked.
verbose(v) boolean create
Prints out all of the plugs being set dirty on stdout.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

# Set everything in the entire scene dirty
#
cmds.dgdirty(a=True);
# Result: 123 #
# Set all connected plugs dirty on "myNode"
# 5 plugs were set dirty
#
cmds.dgdirty( 'myNode' )
# Result: 5 #
# Set all connected plugs dirty on "locator1"
# 0 plugs were connected so no dirty message was sent
#
cmds.dgdirty( 'locator1' )
# Result: 0 #
# Set myNode.tx dirty
cmds.select( 'myNode.tx' )
cmds.dgdirty()
# Result: 1 #
# Show the dirty elements in the node
cmds.dgdirty( list='d' )
# Result: [myNode.tx] #
# Show plugs with dirty state, if any
cmds.dgdirty( list='plug' )
# Result: [myNode.tx, myNode.ty] #
# Show plugs with dirty connections, if any
cmds.dgdirty( list='c' )
# Result: [myNode.ty] #