OpenMaya.MItDag Class Reference
DAG Iterator.
Use the DAG iterator to traverse the DAG either depth first or breadth
first, visiting each node and, if desired, retrieving the node (as an
MObject). The DAG iterator provides a basic filtering capability, so
that DAG node retrieval can be limited to a specific type (MFn.Type)
of node. With filtering enabled the iterator checks to see if the node
is compatible with the type of Function Set specified by the filter.
See MFn.Type for a list of all valid Function set types.
Since each object, if retrieved, is returned as an MObject, the
MObject.hasFn() method can be used to further check for compatible
function set types since an MObjects may be compatible with more than
one function set).
Any compatible Function Set can be attached to the retrieved object to
query or or edit it. Often you will want to use the DAG node Function
Set (MFnDagNode), which is compatible with all DAG objects, to perform
basic queries on each node as the iterator traverses the DAG.
The iterator also provides the capability to reset the root of the
iteration, the type of traversal, and the filter.
Additionally, the iterator can be queried for the root, mode and type
of traversal, and to determine if the the traversal has been completed.
|
int | kBreadthFirst = 2 |
|
int | kDepthFirst = 1 |
|
int | kInvalidType = 0 |
|
OpenMaya.MItDag.__init__ |
( |
| ) |
|
x.__init__(...) initializes x; see help(type(x)) for signature
OpenMaya.MItDag.currentItem |
( |
| ) |
|
currentItem() -> MObject
Retrieves DAG node to which the iterator points.
OpenMaya.MItDag.depth |
( |
| ) |
|
depth() -> integer
Returns the height or depth of the current node in the DAG relative to the
root node. The root node has a depth of zero.
OpenMaya.MItDag.fullPathName |
( |
| ) |
|
fullPathName() -> MString
Return a string representing the full path from the root of the dag to this object.
OpenMaya.MItDag.getAllPaths |
( |
| ) |
|
getAllPaths() -> MDagPathArray
Determines all DAG Paths to current item in the iteration.
OpenMaya.MItDag.getPath |
( |
| ) |
|
getPath() -> MDagPath
Determines a DAG Path to the current item in the iteration.
OpenMaya.MItDag.instanceCount |
( |
| ) |
|
instanceCount(total) -> Integer
Determines the number of times the current item (DAG node) in the iteration
is instanced.
If total is False the number of direct instances is returned, which
is the same as the node's parent count.
If total is True the total number of instances is returned, including
indirect instances resulting from instancing higher up the DAG hierarchy
(i.e. one or more of the node's ancestors also has multiple instances).
OpenMaya.MItDag.isDone |
( |
| ) |
|
isDone() -> Bool
Indicates end of iteration path.
OpenMaya.MItDag.isInstanced |
( |
| ) |
|
isInstanced(indirect = True) -> Bool
Determines whether the current item (DAG node) in the iteration is directly
or indirectly instanced.
If indirect instance flag is False, the result is True if and only if the
Node itself is multiply instanced (node.parentCount > 1).
If the indirect flag is True, the result is True if and only if the Node
itself is multiply instanced (node.parentCount > 1) or if the Node is not
multiply instanced, but it has a directly instanced parent
(node.parentCount()=1 and parent.parentCount >1).
* indirect (Bool) -Indirect instance flag, defaults to True.
next() -> self
Moves to the next node matching the filter in the graph.
OpenMaya.MItDag.partialPathName |
( |
| ) |
|
partialPathName() -> MString
Return a string representing the partial path from the root of the
dag to this object.
The partial path is the minimum path that is still unique. This string
may contain wildcards.
OpenMaya.MItDag.prune |
( |
| ) |
|
prune() -> self
Prunes iteration tree at current node.
OpenMaya.MItDag.reset |
( |
| ) |
|
reset() -> self
reset(rootObject, traversalType = MItDag.kDepthFirst, filterType = MFn.kInvalid) -> self
reset(rootPath, traversalType = MItDag.kDepthFirst, filterType = MFn.kInvalid) -> self
reset(dagInfoObject, rootObject OR rootPath, traversalType = MItDag.kDepthFirst) -> self
Resets the iterator.
When used without parameters, the iterator is reset to the previous traversal setting.
If a dagInfoObject is used, then the type of the provided rootObject or rootPath must
match dagInfoObject.objectType.
rootObject (MObject) - Root node to begin the next traversal.
rootPath (MDagPath) - Root path to to begin the next traversal. Useful with instances.
dagInfoObject (MIteratorType) - Iterator object having info on filter or filterlist.
traversalType (MItDag.TraversalType) - Enumerated type that determines the direction of the traversal, defaults to kDepthFirst.
filterType (MFn.Type) - Function set type, defaults to MFn.kInvalid
root() -> MObject
Returns the root (start node) of the current traversal.
The constructor sets the root of traversal to the world node.
The root can be changed by the reset() method.
OpenMaya.MItDag.traversalType |
( |
| ) |
|
traversalType() -> MItDag.TraversalType
Returns the direction of the traversal.
OpenMaya.MItDag.traverseUnderWorld |
|
static |
Specifies whether underworld traversal is turned on (Bool).