OpenMaya.MDagPath

bnFind DAG path iterator.
bnGet Retrieve a single DAG path.
__hash__ Hash value that can be relied on.
__str__ Full path name.
bnFindChildren DAG path iterator over the children.
bnGetChild Retrieve a single DAG path child.
bnGetParent Retrieve the parent DAG path.

classmethod MDagPath.bnFind(pattern=None, fnType=maya.OpenMaya.MFn.kInvalid, recursive=True, traverseUnderWorld=True, copy=True)[source]

DAG path iterator.

Categories: foundation.

Parameters:
  • pattern (str) – Path or full path pattern of the DAG paths to match. Wildcards are allowed.
  • fnType (maya.OpenMaya.MFn.Type) – Function set type to match.
  • recursive (bool) – True to search recursively.
  • traverseUnderWorld (bool) – True to search within the underworld.
  • copy (bool) – True to copy each DAG path. It is useful when data persistence is required, such as when the DAG paths are to be stored into a list, otherwise it is faster to set it to False.
Yields:

maya.OpenMaya.MDagPath – The paths found.

Note

The pattern matching’s global context is set to full path if the parameter traverseUnderWorld is True, and to path otherwise. See Matching Rules.


classmethod MDagPath.bnGet(pattern=None, fnType=maya.OpenMaya.MFn.kInvalid, recursive=True, traverseUnderWorld=True)[source]

Retrieve a single DAG path.

Categories: foundation.

Parameters:
  • pattern (str) – Path or full path pattern of the DAG path to match. Wildcards are allowed.
  • fnType (maya.OpenMaya.MFn.Type) – Function set type to match.
  • recursive (bool) – True to search recursively.
  • traverseUnderWorld (bool) – True to search within the underworld.
Returns:

The DAG path found. If none or many were found, None is returned.

Return type:

maya.OpenMaya.MDagPath

Note

The pattern matching’s global context is set to full path if the parameter traverseUnderWorld is True, and to path otherwise. See Matching Rules.


MDagPath.__hash__()[source]

Hash value that can be relied on.

This is required because the original method returns different values for multiple instances pointing to a same object, thus making the MDagPath object not usable with hash-based containers such as dictionaries and sets.

Categories: fix.

Returns:The hash value representing this object.
Return type:int

MDagPath.__str__()[source]

Full path name.

It is helpful when interacting with the commands layer by not having to manually call the fullPathName() method each time a MDagPath object needs to be passed to a command.

Categories: fix.

Returns:The full path name.
Return type:str

MDagPath.bnFindChildren(pattern=None, fnType=maya.OpenMaya.MFn.kInvalid, recursive=True, traverseUnderWorld=True, copy=True)[source]

DAG path iterator over the children.

Categories: foundation.

Parameters:
  • pattern (str) – Path or full path pattern of the DAG paths to match, relative to the current DAG path. Wildcards are allowed.
  • fnType (maya.OpenMaya.MFn.Type) – Function set type to match.
  • recursive (bool) – True to search recursively.
  • traverseUnderWorld (bool) – True to search within the underworld.
  • copy (bool) – True to copy each DAG path. It is useful when data persistence is required, such as when the DAG paths are to be stored into a list, otherwise it is faster to set it to False.
Yields:

maya.OpenMaya.MDagPath – The paths found.

Note

The pattern matching’s global context is set to full path if the parameter traverseUnderWorld is True, and to path otherwise. See Matching Rules.


MDagPath.bnGetChild(pattern=None, fnType=maya.OpenMaya.MFn.kInvalid, recursive=True, traverseUnderWorld=True)[source]

Retrieve a single DAG path child.

Categories: foundation.

Parameters:
  • pattern (str) – Path or full path pattern of the DAG path to match, relative to the current DAG path. Wildcards are allowed.
  • fnType (maya.OpenMaya.MFn.Type) – Function set type to match.
  • recursive (bool) – True to search recursively.
  • traverseUnderWorld (bool) – True to search within the underworld.
Returns:

The path found.

Return type:

maya.OpenMaya.MDagPath

Note

The pattern matching’s global context is set to full path if the parameter traverseUnderWorld is True, and to path otherwise. See Matching Rules.


MDagPath.bnGetParent()[source]

Retrieve the parent DAG path.

Categories: foundation.

Returns:The parent DAG path, or None if this DAG path is directly parented under the world.
Return type:maya.OpenMaya.MDagPath or None