Package mrv :: Package maya :: Package nt :: Module base :: Class MDagPathUtil
[hide private]
[frames] | no frames]

Class MDagPathUtil

source code

object --+
         |
        MDagPathUtil

Performs operations on MDagPaths which are hard or inconvenient to do otherwise

Note: We do NOT patch the actual api type as this would make it unusable to be passed in as reference/pointer type unless its being created by maya itself.

Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
    Query
 
parentPath(cls, path)
Returns: MDagPath to the parent of path or None if path is in the scene root.
source code
 
numShapes(cls, path)
Returns: return the number of shapes below path
source code
 
childPathAtIndex(cls, path, index)
Returns: MDagPath pointing to this path's child at the given index
source code
 
childPaths(cls, path, predicate=lambda x: True)
Returns: list of child MDagPaths which have path as parent
source code
    Edit Inplace
 
pop(cls, path, num)
Pop the given number of items off the end of the path
source code
 
extendToChild(cls, path, num)
Extend path to the given child number - can be shape or transform
source code
 
childPathsByFn(cls, path, fn, predicate=lambda x: True)
Get all children below path supporting the given MFn.type
source code
 
shapes(cls, path, predicate=lambda x: True)
Returns: MDagPaths to all shapes below path
source code
 
transforms(cls, path, predicate=lambda x: True)
Returns: MDagPaths to all transforms below path
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

parentPath(cls, path)
Class Method

source code 
Returns:
MDagPath to the parent of path or None if path is in the scene root.

numShapes(cls, path)
Class Method

source code 
Returns:
return the number of shapes below path

childPathAtIndex(cls, path, index)
Class Method

source code 
Returns:
MDagPath pointing to this path's child at the given index

childPaths(cls, path, predicate=lambda x: True)
Class Method

source code 
Parameters:
  • predicate - returns True for each path which should be included in the result.
Returns:
list of child MDagPaths which have path as parent

pop(cls, path, num)
Class Method

source code 
Pop the given number of items off the end of the path
Returns:
path itself

extendToChild(cls, path, num)
Class Method

source code 
Extend path to the given child number - can be shape or transform
Returns:
path itself

childPathsByFn(cls, path, fn, predicate=lambda x: True)
Class Method

source code 
Get all children below path supporting the given MFn.type
Parameters:
  • fn - member of MFn
  • predicate - returns True for each path which should be included in the result.
Returns:
MDagPaths to all matched paths below this path

shapes(cls, path, predicate=lambda x: True)
Class Method

source code 
Parameters:
  • predicate - returns True for each path which should be included in the result.
Returns:
MDagPaths to all shapes below path

Note: have to explicitly assure we do not get transforms that are compatible to the shape function set for some reason - this is just odd and shouldn't be, but it happens if a transform has an instanced shape for example, perhaps even if it is not instanced

transforms(cls, path, predicate=lambda x: True)
Class Method

source code 
Parameters:
  • predicate - returns True to include path in result
Returns:
MDagPaths to all transforms below path