mgear.core.dag module

Nvigate the DAG hierarchy

mgear.core.dag.findChild(node, name)

Returns the first child of input node, with a matching name.

Parameters:
  • node (dagNode) – The input node to search

  • name (str) – The name to search

Returns:

The first child

Return type:

dagNode

>>>  parent = dag.findChild(self.model,
                            mgear.string.convertRLName(
                                comp_guide.root.name()))
mgear.core.dag.findChildren(node, name)

Returns all the children of input node, with a matching name.

Parameters:
  • node (dagNode) – The input node to search

  • name (str) – The name to search

Returns:

The children dagNodes

Return type:

dagNode list

mgear.core.dag.findChildrenPartial(node, name)

Returns the children of input node, with a partial matching name.

Parameters:
  • node (dagNode) – The input node to search

  • name (str) – The name to search

Returns:

The children dagNodes

Return type:

dagNode list

mgear.core.dag.findComponentChildren(node, name, sideIndex)

Returns the component children of input component root.

Note

This method is specific to work with shifter guides naming conventions

Parameters:
  • node (dagNode) – The input node to search

  • name (str) – The name to search

  • sideIndex (str) – the side

Returns:

The children dagNodes

Return type:

dagNode list

>>> objList =  dag.findComponentChildren(self.parent,
                                         oldName,
                                         oldSideIndex)
mgear.core.dag.findComponentChildren2(node, name, sideIndex)

Returns the component children of input component root.

This function is using Maya cmds instead of PyMel

Note

This method is specific to work with shifter guides naming conventions

Parameters:
  • node (dagNode) – The input node to search

  • name (str) – The name to search

  • sideIndex (str) – the side

Returns:

The children dagNodes

Return type:

dagNode list

>>> objList =  dag.findComponentChildren(self.parent,
                                         oldName,
                                         oldSideIndex)
mgear.core.dag.findComponentChildren3(node, name, sideIndex)

Returns the component children of input component root.

This function is using Maya cmds instead of PyMel

Note

This method is specific to work with shifter guides naming conventions

Parameters:
  • node (dagNode) – The input node to search

  • name (str) – The name to search

  • sideIndex (str) – the side

Returns:

The children dagNodes

Return type:

dagNode list

>>> objList =  dag.findComponentChildren(self.parent,
                                         oldName,
                                         oldSideIndex)
mgear.core.dag.getShapes(node)

Returns the shape of the dagNode

Parameters:

node (dagNode) – The input node to search the shape

Returns:

The shapes of the node

Return type:

list

mgear.core.dag.getTopParent(node)

Returns the first parent of the hierarchy.

usually the ‘Model’ in Softimage terminology

Parameters:

node (dagNode) – The input node to search.

Returns:

The top parent of the input node

Return type:

dagNode