pymel.core.system.dgdirty

dgdirty(*args, **kwargs)

The dgdirtycommand 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. If the listflag is used it will return the list of things currently marked as dirty (or clean if the cleanflag was also used). The returned values will be the names of plugs either clean/dirty themselves, at both ends of a clean/dirty connection, or representing the location of clean/dirty data on the node. Be careful using this option in conjunction with the allflag, the list could be huge.

Flags:

Long Name / Short Name Argument Types Properties
allPlugs / a bool ../../../_images/create.gif ../../../_images/query.gif
  Ignore the selected or specified objects and dirty (or clean) all plugs.
clean / c bool ../../../_images/create.gif ../../../_images/query.gif
  If this flag is set then the attributes are cleaned. Otherwise they are set to dirty.
implicit / i bool ../../../_images/create.gif ../../../_images/query.gif
  If this flag is set then allow the implicit or default nodes to be processed as well. Otherwise they will be skipped for efficiency.
list / l unicode ../../../_images/create.gif ../../../_images/query.gif
  When this flag is specified then instead of sending out dirty/clean messages the list of currently dirty/clean objects will be returned. The allPlugsand cleanflags are respected to narrow guide the values to be returned. The value of the flag tells what will be reported. dataor d= show plugs that have dirty/clean dataplugor p= show plugs that have dirty/clean statesconnectionor c= show plugs with connections that have dirty/clean statesQuery this flag to find all legal values of the flag. Query this flag with its value already set to get a description of what that value means. Note that pand cmodes 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 bool ../../../_images/create.gif ../../../_images/query.gif
  If this flag is set then the ability of dirty messages to flow through the graph is left enabled.
showTiming / st bool ../../../_images/create.gif ../../../_images/query.gif
  If this flag is used then show how long the dirty messages took to propagate.
verbose / v bool ../../../_images/create.gif ../../../_images/query.gif
  Prints out all of the plugs being set dirty on stdout. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.dgdirty

Example:

import pymel.core as pm

# Set everything in the entire scene dirty
#
pm.dgdirty(a=True);

# Set all connected plugs dirty on "myNode"
#
pm.dgdirty( 'myNode' )
# Result: 5
# 5 plugs were set dirty

#  Set all connected plugs dirty on "locator1"
pm.dgdirty( 'locator1' )
# Result: 0
# 0 plugs were connected so no dirty message was sent

# Set myNode.tx dirty
pm.select( 'myNode.tx' )
pm.dgdirty()
# Result: 1