Public Member Functions | |
__init__ () | |
__iter__ () | |
currentNode () | |
currentNodeHasUnknownType () | |
currentPlug () | |
getNodePath () | |
getNodesVisited () | |
getPlugPath () | |
getPlugsVisited () | |
isDone () | |
iter () | |
iternext () | |
next () | |
previousPlug () | |
prune () | |
reset () | |
resetFilter () | |
resetTo () | |
rootNode () | |
rootPlug () | |
Properties | |
currentDirection | |
currentFilter | |
currentLevel | |
currentRelationship | |
currentTraversal | |
pruningOnFilter | |
traversingOverWorldSpaceDependents | |
Dependency Graph Iterator. Iterate over Dependency Graph (DG) Nodes or Plugs starting at a specified root Node or Plug. Set and query the root of the iteration. Set and query the direction (downstream or upstream), traversal priority (depth first or breadth first), level of detail (Node level or Plug level) and relationship (dependency, DG connection, eval graph) of the iteration. Set and disable a filter to iterate over only specific types (MFn.Type) of Nodes. Reset the root, filter, direction, traversal priority and level of detail of the iteration. Prune branches of the graph from iteration. In Maya, all geometry, animation and rendering information is implemented in nodes in the Dependency Graph (DG). The DG includes the Directed Acyclic Graph (DAG). Therefore, all DAG nodes are also DG nodes. The data on nodes is associated with Attributes. Attributes on nodes are connected to Attributes on other nodes via plugs on the Attributes. Plugs are, in effect the external intefaces of Attributes. The DG Iterator Class (MItDependencyGraph) provides methods for iterating over either nodes or plugs, as well as methods for setting and querying the characteristics and behaviour of the iterator. This iterator will traverse all connected attributes upstream or downstream from the root node of the traversal. For non root nodes, only attributes that are affected by the incoming attribute to that node will be traversed. Hence, only nodes to which data from the root node is flowing will be traversed. By default, the iterator does not traverse world-space attribute dependencies (an example of a world-space dependency is that translateX affects worldMatrix). The setTraversalOverWorldSpaceDependents method can be used to enable such traversal. Note that even when world-space traversal is enabled, the iterator will only iterate to connected nodes. It does not iterate up and down through the dag hierarchy. The DG Iterator is used in conjunction with the Maya Object (MObject), plug (MPlug), Maya Object Array (MObjectArray) and plug Array (MPlugArray) classes. It is also useful to use Function Sets specific to the nodes returned by the iterator to query and modify the nodes in the DG. The DG itself can be modified using a DG Modifer (MDGModifier). Additionally, nodes can be added to and retrieved from selection lists using the Selection List (MSelectionList) class and Selection List Iterator (MItSelectionList). This can be useful for obtaining the root node for an iteration. Attributes on the nodes can be manipulated using the Attribute Function Set (MFnAttribute) and its derivations.
OpenMaya.MItDependencyGraph.__init__ | ( | ) |
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
OpenMaya.MItDependencyGraph.__iter__ | ( | ) |
x.__iter__() <==> iter(x)
OpenMaya.MItDependencyGraph.currentNode | ( | ) |
currentNode() -> MObject Retrieves the current node of the iteration. Results in a null object on failure or if the node is of a unrecognized type.
OpenMaya.MItDependencyGraph.currentNodeHasUnknownType | ( | ) |
currentNodeHasUnknownType() -> Bool Indicates whether or not the current node has an unrecognised type. This is useful if an unexpected failure is encountered in the next() or currentNode() methods.
OpenMaya.MItDependencyGraph.currentPlug | ( | ) |
currentPlug() -> MPlug Retrieves the current plug of the iteration. Results in a null plug on failure.
OpenMaya.MItDependencyGraph.getNodePath | ( | ) |
getNodePath() -> MObjectArray Retrieves the direct path from the current node to the root node. Path does not include the current node. State of the provided array is undefined if this method fails.
OpenMaya.MItDependencyGraph.getNodesVisited | ( | ) |
getNodesVisited() -> MObjectArray Retrieves all nodes visited during the iteration. State of the provided array is undefined if this method fails.
OpenMaya.MItDependencyGraph.getPlugPath | ( | ) |
getPlugPath() -> MPlugArray Retrieves the direct path from the current plug to the root plug, with the current plug in element 0 of the array and the root plug in the final element of the array. Once the iterator is done (i.e. isDone() returns True) there is no longer a current plug and this method will return an empty array. If this method fails the state of the returned array is undefined.
OpenMaya.MItDependencyGraph.getPlugsVisited | ( | ) |
getPlugsVisited() -> MPlugArray Retrieves all plugs visited during the iteration. State of the provided array is undefined if this method fails.
OpenMaya.MItDependencyGraph.isDone | ( | ) |
isDone() -> Bool Indicates whether or not all nodes or plugs have been iterated over in accordance with the direction, traversal, level, relationship and filter. If a valid filter is set, the iterator only visits those nodes that match the filter.
OpenMaya.MItDependencyGraph.iter | ( | ) |
iter() -> self Initializes the iterator object for pythonic iteration.
OpenMaya.MItDependencyGraph.iternext | ( | ) |
iternext() -> self Used in pythonic iteration to move the iterator
OpenMaya.MItDependencyGraph.next | ( | ) |
x.next() -> the next value, or raise StopIteration
OpenMaya.MItDependencyGraph.previousPlug | ( | ) |
previousPlug() -> MPlug Retrieves the previous plug of the iteration. Results in a null plug on failure. Null plug may also indicate that the current plug is the root plug.
OpenMaya.MItDependencyGraph.prune | ( | ) |
prune() -> self Prunes the search path at the current plug. Iterator will not visit any of the plugs connected to the pruned plug.
OpenMaya.MItDependencyGraph.reset | ( | ) |
reset() -> self Clears iterator data and resets the iterator to the root node or plug. If a valid filter is enabled, the iterator automatically advances to the next node after the root node that matches the filter. If no matching node is found an exception is thrown.
OpenMaya.MItDependencyGraph.resetFilter | ( | ) |
resetFilter() -> self Resets the node or plug filter to default, MFn.kInvalid (filter disabled). Disables pruning on the filter (default). Resets the iterator.
OpenMaya.MItDependencyGraph.resetTo | ( | ) |
resetTo(rootObject, filter = MFn.kInvalid, direction = MItDependencyGraph.kDownstream, traversal = MItDependencyGraph.kDepthFirst, level = MItDependencyGraph.kNodeLevel, relationship = MItDependencyGraph.kDependsOn) -> self resetTo(rootPlug, filter = MFn.kInvalid, direction = MItDependencyGraph.kDownstream, traversal = MItDependencyGraph.kDepthFirst, level = MItDependencyGraph.kNodeLevel, relationship = MItDependencyGraph.kDependsOn) -> self resetTo(infoObject, rootObject OR rootPlug, direction = MItDependencyGraph.kDownstream, traversal = MItDependencyGraph.kDepthFirst, level = MItDependencyGraph.kNodeLevel, relationship = MItDependencyGraph.kDependsOn) -> self Clears iterator data and re-initializes the iterator. If a valid filter is provided, the iterator automatically advances to the next node after the root node that matches the filter. If no matching node is found an exception is thrown. rootObject (MObject) - Root node to begin the next traversal. rootPlug (MPlug) - Root plug to to begin the next traversal. infoObject (MIteratorType) - Iterator object having info on filter or filterlist. filter (MFn.Type) - Function set type, defaults to MFn.kInvalid direction (MItDependencyGraph.Direction) - Primary direction of iteration, defaults to MItDependencyGraph.kDownstream traversal (MItDependencyGraph.Traversal) - Order of traversal, defaults to MItDependencyGraph.kDepthFirst level (MItDependencyGraph.Level) - Level of detail of the iteration, defaults to MItDependencyGraph.kNodeLevel relationship (MItDependencyGraph.Relationship) - Relationship mode of the iteration, defaults to MItDependencyGraph.kDependsOn
OpenMaya.MItDependencyGraph.rootNode | ( | ) |
rootNode() -> MObject Retrieves the root node of the iteration.
OpenMaya.MItDependencyGraph.rootPlug | ( | ) |
rootPlug() -> MPlug Retrieves the root plug of the iteration.
|
static |
Direction of the iteration through the graph (MItDependencyGraph.Direction).
|
static |
Current node type filter (MFn.Type) .
|
static |
Level of the iteration through the graph (MItDependencyGraph.Level).
|
static |
Relationship mode of the iteration through the graph (MItDependencyGraph.Relationship).
|
static |
Traversal mode of the iteration through the graph (MItDependencyGraph.Traversal).
|
static |
Whether or not the iteration path is pruned automatically at nodes or plugs which do not match the filter (Bool).
|
static |
Whether the iterator is set to traverse world-space attribute dependencies (Bool).