pymel.core.general.listRelatives

listRelatives(*args, **kwargs)

This command lists parents and children of DAG objects. The flags -c/children, -ad/allDescendents, -s/shapes, -p/parent and -ap/allParents are mutually exclusive. Only one can be used in a command. When listing parents of objects directly under the world, the command will return an empty parent list. Listing parents of objects directly under a shape (underworld objects) will return their containing shape node in the list of parents. Listing parents of components of objects will return the object. When listing children, shape nodes will return their underworld objects in the list of children. Listing children of components of objects returns nothing. The -ni/noIntermediate flag works with the -s/shapes flag. It causes any intermediate shapes among the descendents to be ignored.

Maya Bug Fix:
  • allDescendents and shapes flags did not work in combination
Modifications:
  • returns an empty list when the result is None

  • returns wrapped classes

  • fullPath is forced on to ensure that all returned node paths are unique

    rtype:DependNode list
Flags:
  • allDescendents : ad (bool) [create]

    Returns all the children, grand-children etc. of this dag node. If a descendent is instanced, it will appear only once on the list returned. Note that it lists grand-children before children.

  • allParents : ap (bool) [create]

    Returns all the parents of this dag node. Normally, this command only returns the parent corresponding to the first instance of the object

  • children : c (bool) [create]

    List all the children of this dag node (default).

  • fullPath : f (bool) [create]

    Return full pathnames instead of object names.

  • noIntermediate : ni (bool) [create]

    No intermediate objects

  • parent : p (bool) [create]

    Returns the parent of this dag node

  • path : pa (bool) [create]

    Return a proper object name that can be passed to other commands.

  • shapes : s (bool) [create]

    List all the children of this dag node that are shapes (ie, not transforms)

  • type : typ (unicode) [create]

    List all relatives of the specified type. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.listRelatives

Previous topic

pymel.core.general.listNodeTypes

Next topic

pymel.core.general.listSets

Core

Core Modules

Other Modules

This Page