class MItDependencyGraph

Jump to documentation

Dependency Graph Iterator. (OpenMaya) (OpenMaya.py)

public members:

enum Direction
Direction within the DG relative to root Node or Plug
kDownstream
From source to destination
kUpstream
From destination to source
enum Traversal
Perform a depth first or breadth first traversal
kDepthFirst
Away from root first
kBreadthFirst
Equidistant from root first
enum Level
Level of detail of the iteration
kNodeLevel
Visit each Node at most once
kPlugLevel
Visit each Plug at most once
MItDependencyGraph ( MObject & rootNode , MFn::Type filter = MFn::kInvalid, Direction direction = kDownstream , Traversal traversal = kDepthFirst , Level level = kNodeLevel , MStatus * ReturnStatus = NULL )
MItDependencyGraph ( MPlug & rootPlug , MFn::Type filter = MFn::kInvalid, Direction direction = kDownstream , Traversal traversal = kDepthFirst , Level level = kPlugLevel , MStatus * ReturnStatus = NULL )
MItDependencyGraph ( MObject & rootNode , MPlug & rootPlug , MIteratorType & infoObject, Direction direction = kDownstream , Traversal traversal = kDepthFirst , Level level = kNodeLevel , MStatus * ReturnStatus = NULL )
~MItDependencyGraph ()
MStatus reset ()
MStatus resetTo ( MObject & rootNode , MFn::Type filter = MFn::kInvalid, Direction direction = kDownstream , Traversal traversal = kDepthFirst , Level level = kNodeLevel )
MStatus resetTo ( MPlug & rootPlug , MFn::Type filter = MFn::kInvalid, Direction direction = kDownstream , Traversal traversal = kDepthFirst , Level level = kPlugLevel )
MStatus resetTo ( MObject * rootNode , MPlug * rootPlug , MIteratorType & infoObject, Direction direction = kDownstream , Traversal traversal = kDepthFirst , Level level = kPlugLevel )
MObject rootNode ( MStatus * ReturnStatus = NULL )
MPlug rootPlug ( MStatus * ReturnStatus = NULL )
MFn::Type currentFilter ( MStatus * ReturnStatus = NULL )
MStatus setCurrentFilter ( MFn::Type filter = MFn::kInvalid )
MStatus resetFilter ()
bool isPruningOnFilter ( MStatus * ReturnStatus = NULL )
MStatus enablePruningOnFilter ()
MStatus disablePruningOnFilter ()
bool isDirectionDownStream ( MStatus * ReturnStatus = NULL )
Direction currentDirection ( MStatus * ReturnStatus = NULL )
MStatus toggleDirection ( )
bool isTraversalDepthFirst ( MStatus * ReturnStatus = NULL )
Traversal currentTraversal ( MStatus * ReturnStatus = NULL )
MStatus toggleTraversal ( )
bool atNodeLevel ( MStatus * ReturnStatus = NULL )
Level currentLevel ( MStatus * ReturnStatus = NULL )
MStatus toggleLevel ( )
MStatus next ( )
bool isDone ( MStatus * ReturnStatus = NULL )
MStatus prune ( )
MObject thisNode ( MStatus * ReturnStatus = NULL )
OBSOLETE
MObject currentItem ( MStatus * ReturnStatus = NULL )
bool thisNodeHasUnknownType ( MStatus * ReturnStatus = NULL )
MPlug thisPlug ( MStatus * ReturnStatus = NULL )
MPlug previousPlug ( MStatus * ReturnStatus = NULL )
MStatus getNodesVisited ( MObjectArray & nodesVisted ) const
MStatus getPlugsVisited ( MPlugArray & plugsVisted ) const
MStatus getNodePath ( MObjectArray & path ) const
MStatus getPlugPath ( MPlugArray & path ) const

Documentation

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) and level of detail (Node level or Plug level) of the iteration.

Set and disable a filter to iterate over only speicifc 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.

Description

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 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.

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.

Functions

MItDependencyGraph:: MItDependencyGraph ( MObject & rootNode , MFn::Type filter, Direction direction, Traversal traversal, Level level, MStatus * ReturnStatus )

Description

Constructor for a DG Iterator with a root node. 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 the status is failure (MFn::kFailure).

Arguments

  • rootNode Root node
  • filter Object type filter (see MFn::Type)
  • direction Primary direction of iteration
    • kDownstream In the direction of data flow
    • kUpstream In the opposite direction of data flow
  • traversal Order of traversal
    • kDepthFirst Away from the root first
    • kBreadthFirst Equidistant from root first
  • level Level of detail of the iteration
    • kNodeLevel Iterate over nodes only
    • kPlugLevel Iterate over plugs
  • ReturnStaus Status Code (see below)

Status Codes

  • MS::kSuccess Iterator created
  • MS::kInvalidParameter Invalid parameter passed for direction, traversal, or level - default used
  • MS::kFailure Could not create iterator

MItDependencyGraph:: MItDependencyGraph ( MPlug & rootPlug , MFn::Type filter, Direction direction, Traversal traversal, Level level, MStatus * ReturnStatus )

Description

Constructor for a DG Iterator with a root plug. The type of root and the level of the iteration are independent. 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 the status is failure (MFn::kFailure).

Arguments

  • rootPlug Root plug
  • filter Object type filter (see MFn::Type)
  • direction Primary direction of iteration
    • kDownstream In the direction of data flow
    • kUpstream In the opposite direction of data flow
  • traversal Order of traversal
    • kDepthFirst Away from the root first
    • kBreadthFirst Equidistant from root first
  • level Level of detail of the iteration
    • kNodeLevel Iterate over nodes only
    • kPlugLevel Iterate over plugs
  • ReturnStaus Status Code (see below)

Status Codes

  • MS::kSuccess Iterator created
  • MS::kInvalidParameter Invalid parameter passed for direction, traversal, or level - default used
  • MS::kFailure Could not create iterator

MItDependencyGraph:: MItDependencyGraph ( MObject & rootNode , MPlug & rootPlug , MIteratorType & infoObject, Direction direction, Traversal traversal, Level level, MStatus * ReturnStatus )

Description

Constructor for a DG Iterator with a root node or a root plug. If the root node is to be specified, then the root plug will be null. If root plug is non-null, then null should be passed on to root node. The type of root and the level of the iteration are independent. If a valid filter is enabled, the iterator automatically advances to the next node after the root node that matches one of the filter in the filter list, which is specified thro' MIteratorType object. no matching node is found the status is failure (MFn::kFailure).

Arguments

  • rootNode Root node, to which the iterator has to be set to, This can be NULL if we are resetting the root to plug object.
  • rootPlug Root plug, to which the iterator has to be set to, This can be NULL if we are resetting the root to node object.
  • infoObjectMIteratorType object, having info about the filter list.
  • level Level of detail of the iteration
    • kNodeLevel Iterate over nodes only
    • kPlugLevel Iterate over plugs
  • direction Primary direction of iteration
    • kDownstream In the direction of data flow
    • kUpstream In the opposite direction of data flow
  • traversal Order of traversal
    • kDepthFirst Away from the root first
    • kBreadthFirst Equidistant from root first
  • ReturnStaus Status Code (see below)

Status Codes

  • MS::kSuccess Iterator created
  • MS::kInvalidParameter Invalid parameter passed for direction, traversal, or level - default used
  • MS::kFailure Could not create iterator

MItDependencyGraph:: ~MItDependencyGraph ()

Description

Class destructor.

MStatus MItDependencyGraph:: reset ()

Description

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 the status is failure (MFn::kFailure).

Return Value

  • Status Code (see below)

Status Codes

  • MS::kSuccess Iterator reset
  • MS::kFailure Iterator not reset - could not access iterator, or iterator does not exist

MStatus MItDependencyGraph:: resetTo ( MObject & rootNode , MFn::Type filter, Direction direction, Traversal traversal, Level level )

Description

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 the status is failure (MFn::kFailure).

Arguments

  • rootNode Root node of the iteration
  • filter Object type filter (see MFn::Type)
  • direction Primary direction of iteration
    • kDownstream In the direction of data flow
    • kUpstream In the opposite direction of data flow
  • traversal Order of traversal
    • kDepthFirst Away from the root first
    • kBreadthFirst Equidistant from root first
  • level Level of detail of the iteration
    • kNodeLevel Iterate over nodes only
    • kPlugLevel Iterate over plugs
  • ReturnStaus Status Code (see below)

Return Value

  • Status Code (see below)

Status Codes

  • MS::kSuccess Iterator created
  • MS::kInvalidParameter Invalid parameter passed for direction, traversal, or level - default used, or Invalid parameter passed for root node - node does not exist or is not accesible
  • MS::kFailure Iterator not reset - iterator does not exist or is not accessible

MStatus MItDependencyGraph:: resetTo ( MPlug & rootPlug , MFn::Type filter, Direction direction, Traversal traversal, Level level )

Description

Clears iterator data and re-initializes the iterator. 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 the status is failure (MFn::kFailure).

Arguments

  • rootPlug Root plug of the iteration
  • filter Object type filter (see MFn::Type)
  • direction Primary direction of iteration
    • kDownstream In the direction of data flow
    • kUpstream In the opposite direction of data flow
  • traversal Order of traversal
    • kDepthFirst Away from the root first
    • kBreadthFirst Equidistant from root first
  • level Level of detail of the iteration
    • kNodeLevel Iterate over nodes only
    • kPlugLevel Iterate over plugs

Return Value

  • Status Code (see below)

Status Codes

  • MS::kSuccess Iterator created
  • MS::kInvalidParameter Invalid parameter passed for direction, traversal, or level - default used, or Invalid parameter passed for root node - node does not exist or is not accesible
  • MS::kFailure Iterator not reset - iterator does not exist or is not accessible

MStatus MItDependencyGraph:: resetTo ( MObject * rootNode , MPlug * rootPlug , MIteratorType & infoObject, Direction direction, Traversal traversal, Level level )

Description

Clears iterator data and re-initializes the iterator. The filter list is reset to the new list specified thro' MIteratorType object. If a valid filter is enabled, the iterator automatically advances to the next node after the root node/plug that matches the filter. If no matching node is found the status is failure (MFn::kFailure).

Arguments

  • rootNode Root Node of the iteration. This can be null if the root has to be reset to plug.
  • rootPlug Root plug of the iteration. This can be null if the root has to be reset to node.
  • infoObjectMIteratorType Object which has info about the filter list and the object type, the root will be reset to.
  • direction Primary direction of iteration
    • kDownstream In the direction of data flow
    • kUpstream In the opposite direction of data flow
  • traversal Order of traversal
    • kDepthFirst Away from the root first
    • kBreadthFirst Equidistant from root first
  • level Level of detail of the iteration
    • kNodeLevel Iterate over nodes only
    • kPlugLevel Iterate over plugs

Return Value

  • Status Code (see below)

Status Codes

  • MS::kSuccess Iterator created
  • MS::kInvalidParameter Invalid parameter passed for direction, traversal, or level - default used, or Invalid parameter passed for root node - node does not exist or is not accesible
  • MS::kFailure Iterator not reset - iterator does not exist or is not accessible

MObject MItDependencyGraph:: rootNode ( MStatus * ReturnStatus )

Description

Retrieves the root node of the iteration.

Arguments

  • ReturnStatus Status Code (see below)

Return Value

  • The root node

Status Codes

  • MS::kSuccess Root node is valid
  • MS::kFailure Root node not retrieved - iterator does not exist or is not accessible, or root node does not exist or is not accessible

MPlug MItDependencyGraph:: rootPlug ( MStatus * ReturnStatus )

Description

Retrieves the root plug of the iteration.

Arguments

  • ReturnStatus Status Code (see below)

Return Value

  • The root plug

Status Codes

  • MS::kSuccess Root plug is valid
  • MS::kFailure Root plug not retrieved - iterator does not exist or is not accessible, or root plug does not exist or is not accessible

MFn::Type MItDependencyGraph:: currentFilter ( MStatus * ReturnStatus )

Description

Retrieves the current node type filter.

Arguments

  • ReturnStatus Status Code (see below)

Return Value

  • the current node type filter

Status Codes

  • MS::kSuccess Filter is valid
  • MS::kFailure Filter status not known - iterator does not exist or is not accessible

MStatus MItDependencyGraph:: setCurrentFilter ( MFn::Type filter )

Description

Sets the node or plug filter. Plug filtering is based on the type of the corresponding Attribute. Defaults to disabled (MFn::kInvalid). If a valid filter is specified, the iterator automatically advances to the next node that matches the filter. If no matching node status is failure (MFn::kFailure).

Disables pruning on the new filter (default). Use enablePruningOnFilter() method to enable pruning. No other iterator data is changed. If new filter is the same as current filter, no action is taken.

Arguments

  • filter node or Attribute type filter (see MFn::Type)

Return Value

  • Status Code (see below)

Status Codes

  • MS::kSuccess Filter is set
  • MS::kInvalidParameter Speicified filter the same as current filter
  • MS::kFailure Filter not set - iterator does not exist or is not accessible

MStatus MItDependencyGraph:: resetFilter ()
Description

Resets the node or plug filter to default, MFn::kInvalid (filter disabled). Disables pruning on the filter (default). Resets the iterator.

Return Value

  • Status Code (see below)

Status Codes

  • MS::kSuccess Filter is reset
  • MS::kFailure Filter not reset - iterator does not exist or is not accessible

bool MItDependencyGraph:: isPruningOnFilter ( MStatus * ReturnStatus )

Description

Tests whether or not the iteration path is pruned automatically at nodes or plugs which do not match the filter.

Arguments

  • ReturnStatus Status Code (see below)

Return Value

  • true Pruning enabled
  • false Pruning disabled

Status Codes

  • MS::kSuccess State is valid
  • MS::kFailure Pruning state not known (default returned) - iterator does not exist or is not accessible

MStatus MItDependencyGraph:: enablePruningOnFilter ()
Description

Enables automatic pruning of iteration path at nodes or plugs which do not match the filter.

Return Value

  • Status Code (see below)

Status Codes

  • MS::kSuccess Pruning enabled
  • MS::kFailure Pruning state not known - iterator does not exist or is not accessible

MStatus MItDependencyGraph:: disablePruningOnFilter ()

Description

Disables automatic pruning of iteration path at nodes or plugs which do not match the filter.

Return Value

  • Status Code (see below)

Status Codes

  • MS::kSuccess Pruning disabled
  • MS::kFailure Pruning state not known - iterator does not exist or is not accessible

bool MItDependencyGraph:: isDirectionDownStream ( MStatus * ReturnStatus )

Description

Tests whether or not the iteration is moving downstream (in the direction of data flow) in the DG.

Arguments

  • ReturnStatus Status Code (see below)

Return Value

  • true Direction is downstream (MItDependencyGraph::kDownstream)
  • false Direction is upstream (MItDependencyGraph::kUpstream)

Status Codes

  • MS::kSuccess Direction is valid
  • MS::kFailure Direction not known (default returned) - iterator does not exist or is not accessible

MItDependencyGraph::Direction MItDependencyGraph:: currentDirection ( MStatus * ReturnStatus )

Description

Reports the direction of the iteration through the graph.

Arguments

  • ReturnStatus Status Code (see below)

Return Value

  • MItDependencyGraph::kDownstream Direction is downstream
  • MItDependencyGraph::kDownstream Direction is upstream

Status Codes

  • MS::kSuccess Direction is valid
  • MS::kFailure Direction not known (default returned) - iterator does not exist or is not accessible

MStatus MItDependencyGraph:: toggleDirection ()

Description

Toggles the direction of the iteration. Resets the root of the iteration to the current node or plug depending on the level of iteration. Clears iterator path data. If a valid filter is enabled, the iterator automatically advances to the next node that matches the filter. If no matching node is found the status is failure (MFn::kFailure). No other iterator parameters are affected.

Return Value

  • Status Code (see below)

Status Codes

  • MS::kSuccess Direction toggled
  • MS::kFailure Direction not toggled - iterator does not exist or is not accessible

bool MItDependencyGraph:: isTraversalDepthFirst ( MStatus * ReturnStatus )

Description

Tests whether or not the iteration is proceeding depth first (away from the root of the iteration) in the DG.

Arguments

  • ReturnStatus Status Code (see below)

Return Value

  • true Traversal is depth first (MItDependencyGraph::kDepthFirst)
  • false Traversal is breadth first (MItDependencyGraph::kBreadthFirst)

Status Codes

  • MS::kSuccess Traversal is valid
  • MS::kFailure Traversal not known (default returned) - iterator does not exist or is not accessible

MItDependencyGraph::Traversal MItDependencyGraph:: currentTraversal ( MStatus * ReturnStatus )

Description

Reports the traversal mode of the iteration through the graph.

Arguments

  • ReturnStatus Status Code (see below)

Return Value

  • MItDependencyGraph::kDepthFirst Traversal is depth first
  • MItDependencyGraph::kBreadthFirst Traversal is breadth first

Status Codes

  • MS::kSuccess Traversal is valid
  • MS::kFailure Traversal not known (default returned) - iterator does not exist or is not accessible

MStatus MItDependencyGraph:: toggleTraversal ()

Description

Toggles the traversal of the iteration. Resets the root of the iteration to the current node or plug depending on the level of iteration. Clears iterator path data. If a valid filter is enabled, the iterator automatically advances to the next node that matches the filter. If no matching node is found the status is failure (MFn::kFailure). No other iterator parameters are affected.

Return Value

  • Status Code (see below)

Status Codes

  • MS::kSuccess Traversal toggled
  • MS::kFailure Traversal not toggled - iterator does not exist or is not accessible

bool MItDependencyGraph:: atNodeLevel ( MStatus * ReturnStatus )

Description

Tests whether or not the iteration is at the node level of detail (every node is visited only once) in the DG.

Arguments

  • ReturnStatus Status Code (see below)

Return Value

  • true node level (MItDependencyGraph::kNodeLevel)
  • false plug level (MItDependencyGraph::kPlugLevel)

Status Codes

  • MS::kSuccess Level is valid
  • MS::kFailure Level not known (default returned) - iterator does not exist or is not accessible

MItDependencyGraph::Level MItDependencyGraph:: currentLevel ( MStatus * ReturnStatus )

Description

Reports the level of the iteration through the graph.

Arguments

  • ReturnStatus Status Code (see below)

Return Value

  • MItDependencyGraph::kNodeLevel Level is node level
  • MItDependencyGraph::kPlugLevel Level is plug level

Status Codes

  • MS::kSuccess Level is valid
  • MS::kFailure Level not known (default returned) - iterator does not exist or is not accessible

MStatus MItDependencyGraph:: toggleLevel ()

Description

Toggles the level of the iteration. Resets the root of the iteration to the current node or plug depending on the level of iteration. Clears iterator path data. If a valid filter is enabled, the iterator automatically advances to the next node that matches the filter. If no matching node is found the status is failure (MFn::kFailure). No other iterator parameters are affected.

Return Value

  • Status Code (see below)

Status Codes

  • MS::kSuccess Level toggled
  • MS::kFailure Level not toggled - iterator does not exist or is not accessible

MStatus MItDependencyGraph:: next ()

Description

Iterates to the next node or plug in accordance with the direction, traversal, level and filter. If a valid filter is set, the iterator only visits those nodes that match the filter. When filtering is enabled nodes that have unknown type are treated as non-matching nodes. With filtering disabled, iteration to a node with an unknown type is treated as a failure. An attempt to iterate when there is nothing left to iterate over results in failure.

Return Value

  • Status Code (see below)

Status Codes

  • MS::kSuccess Iteration successful
  • MS::kFailure Could not iterate - nothing left to iterate over, or iterator does not exist or is not accessible, or node has unrecognized type, or Attribute of plug is inaccessible, or could not update plug path length.

bool MItDependencyGraph:: isDone ( MStatus * ReturnStatus )

Description

Indicates whether or not all nodes or plugs have been iterated over in accordance with the direction, traversal, level and filter. If a valid filter is set, the iterator only visits those nodes that match the filter.

Arguments

  • ReturnStatus Status Code (see below)

Return Value

  • true Iteration is done
  • false Iteration is not done

Status Codes

  • MS::kSuccess Return valid
  • MS::kFailure Return not valid - iterator does not exist or is not accessible

MStatus MItDependencyGraph:: prune ()

Description

Prunes the search path at the current plug. Iterator will not visit any of the plugs connected to the pruned plug.

Return Value

  • Status Code (see below)

Status Codes

  • MS::kSuccess Path pruned.
  • MS::kFailure Could not prune path - iterator does not exist or is not accessible, or iteration is done

MObject MItDependencyGraph:: thisNode ( MStatus * ReturnStatus )

Description

This method is OBSOLETE, please use the currentItem method.

Retrieves the current node of the iteration. Results in a null object on failure or if the node is of a unrecognized type.

Arguments

  • ReturnStatus Status Code (see below)

Return Value

  • Current node

Status Codes

  • MS::kSuccess node is valid
  • MS::kFailure node not retrieved - iterator does not exist or is not accessible, or node does not exist or is not accessible, or node type is not recognized, or iteration is done (null Object returned)

MObject MItDependencyGraph:: currentItem ( MStatus * ReturnStatus )

Description

Retrieves the current node of the iteration. Results in a null object on failure or if the node is of a unrecognized type.

Arguments

  • ReturnStatus Status Code (see below)

Return Value

  • Current node

Status Codes

  • MS::kSuccess node is valid
  • MS::kFailure node not retrieved - iterator does not exist or is not accessible, or node does not exist or is not accessible, or node type is not recognized, or iteration is done (null Object returned)

bool MItDependencyGraph:: thisNodeHasUnknownType ( MStatus * ReturnStatus )

Description

Indicates whether or not the current node has an unrecognised type. This is useful if an unexpected failure is encountered in the next() or thisNode() methods.

Returns true only if node exists but is not a recognizable type.

Returns false if node exists and is recognizable. Also returns false on failure or if the iteration is done.

Arguments

  • ReturnStatus Status Code (see below)

Return Value

  • true Unknown type
  • false Type is known or iterator is done or failure encountered

Status Codes

  • MS::kSuccess Return valid
  • MS::kFailure Return not valid - iterator does not exist or is not accessible, or node does not exist or is not accessible

MPlug MItDependencyGraph:: thisPlug ( MStatus * ReturnStatus )

Description

Retrieves the current plug of the iteration. Results in a null plug on failure.

Arguments

  • ReturnStatus Status Code (see below)

Return Value

  • Current plug

Status Codes

  • MS::kSuccess plug is valid
  • MS::kFailure plug not retrieved - the iteration is done, iterator does not exist or is not accessible, or plug does not exist or is not accessible (null plug returned)

MPlug MItDependencyGraph:: previousPlug ( MStatus * ReturnStatus )

Description

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.

Arguments

  • ReturnStatus Status Code (see below)

Return Value

  • Current plug

Status Codes

  • MS::kSuccess plug is valid
  • MS::kFailure plug not retrieved - iterator does not exist or is not accessible, plug does not exist or is not accessible, or current plug may be root plug (null plug returned)

MStatus MItDependencyGraph:: getNodesVisited ( MObjectArray & nodes ) const

Description

Retrieves all nodes visited during the iteration. State of the provided array is undefined if this method fails.

Arguments

  • nodes Target array for retrieved nodes. On success contains all nodes visited

Return Value

  • Status Code (see below)

Status Codes

  • MS::kSuccess
  • MS::kFailure Could not retrieve nodes - iterator does not exist or is not accessible, or list of nodes does not exist or is not accessible;

MStatus MItDependencyGraph:: getPlugsVisited ( MPlugArray & plugs ) const

Description

Retrieves all plugs visited during the iteration. State of the provided array is undefined if this method fails.

Arguments

  • plugs Target array for retrieved plugs. On success contains all plugs visited

Return Value

  • Status Code (see below)

Status Codes

  • MS::kSuccess
  • MS::kFailure Could not retrieve plugs - iterator does not exist or is not accessible, or list of plugs does not exist or is not accessible;

MStatus MItDependencyGraph:: getNodePath ( MObjectArray & path ) const

Description

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.

Arguments

  • path Target array for retrieved path. On success contains direct path from the current node to the root node

Return Value

  • Status Code (see below)

Status Codes

  • MS::kSuccess
  • MS::kFailure Could not retrieve path - iterator does not exist or is not accessible, or path does not exist or is not accessible;

MStatus MItDependencyGraph:: getPlugPath ( MPlugArray & path ) const

Description

Retrieves the direct path from the current plug to the root plug. Path does not include the current plug. State of the provided array is undefined if this method fails.

Arguments

  • path Target array for retrieved path. On success contains direct path from the current plug to the root plug

Return Value

  • Status Code (see below)

Status Codes

  • MS::kSuccess
  • MS::kFailure Could not retrieve path - iterator does not exist or is not accessible, or path does not exist or is not accessible;

Description

Checks if the given Mobject has any of the function type given in the filter list.

Arguments

  • ReturnStatus Status Code (see below).

Return Value

  • Boolean indicating whether the object is having the given function type or not.

Status Codes

  • MS::kSuccess Success
  • MS::kFailure Object error

Description

Gets the current iterator, by taking into account, the direction of traversal, traversal type, and level.

Arguments

  • rootNode Root node, maybe null if the call is made from MItDependencyGraph(MPlug&)
  • rootPlug Root plug, maybe null if the call is made from MItDependencyGraph(MObject&)
  • direction Primary direction of iteration
    • kDownstream In the direction of data flow
    • kUpstream In the opposite direction of data flow
  • traversal Order of traversal
    • kDepthFirst Away from the root first
    • kBreadthFirst Equidistant from root first
  • level Level of detail of the iteration
    • kNodeLevel Iterate over nodes only
    • kPlugLevel Iterate over plugs
  • ReturnStaus Status Code (see below)

Status Codes

  • MS::kSuccess Iterator created
  • MS::kInvalidParameter Invalid parameter passed for direction, traversal, or level - default used
  • MS::kFailure Could not create iterator

Description

Resets the current iterator, by taking into account, the direction of traversal, traversal type, and level.

Arguments

  • rootNode Root node, maybe null if the call is made from MItDependencyGraph(MPlug&)
  • rootPlug Root plug, maybe null if the call is made from MItDependencyGraph(MObject&)
  • direction Primary direction of iteration
    • kDownstream In the direction of data flow
    • kUpstream In the opposite direction of data flow
  • traversal Order of traversal
    • kDepthFirst Away from the root first
    • kBreadthFirst Equidistant from root first
  • level Level of detail of the iteration
    • kNodeLevel Iterate over nodes only
    • kPlugLevel Iterate over plugs
  • ReturnStaus Status Code (see below)

Status Codes

  • MS::kSuccess Iterator created
  • MS::kInvalidParameter Invalid parameter passed for direction, traversal, or level - default used
  • MS::kFailure Could not create iterator

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright