pymel.core.nodetypes.DagNode

digraph inheritance1afa7630c8 {
rankdir=TB;
ranksep=0.15;
nodesep=0.15;
size="8.0, 12.0";
  "DagNode" [fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,URL="#pymel.core.nodetypes.DagNode",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8];
  "Entity" -> "DagNode" [arrowsize=0.5,style="setlinewidth(0.5)"];
  "Entity" [fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,URL="pymel.core.nodetypes.Entity.html#pymel.core.nodetypes.Entity",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8];
  "ContainerBase" -> "Entity" [arrowsize=0.5,style="setlinewidth(0.5)"];
  "PyNode" [fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,URL="../pymel.core.general/pymel.core.general.PyNode.html#pymel.core.general.PyNode",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8];
  "ProxyUnicode" -> "PyNode" [arrowsize=0.5,style="setlinewidth(0.5)"];
  "ContainerBase" [fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,URL="pymel.core.nodetypes.ContainerBase.html#pymel.core.nodetypes.ContainerBase",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8];
  "DependNode" -> "ContainerBase" [arrowsize=0.5,style="setlinewidth(0.5)"];
  "ProxyUnicode" [fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,URL="../pymel.util.utilitytypes/pymel.util.utilitytypes.ProxyUnicode.html#pymel.util.utilitytypes.ProxyUnicode",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8];
  "DependNode" [fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,URL="pymel.core.nodetypes.DependNode.html#pymel.core.nodetypes.DependNode",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8];
  "PyNode" -> "DependNode" [arrowsize=0.5,style="setlinewidth(0.5)"];
}

class DagNode(*args, **kwargs)
addChild(child, **kwargs)

parent (reversed)

Return type:DagNode
boundingBox()

Returns the bounding box for the dag node in object space.

Return type:BoundingBox

Derived from api method maya.OpenMaya.MFnDagNode.boundingBox

childAtIndex(i)

Queries the DAG Node attached to the Function Set for the child Node corresponding to the given index.

Parameters:
i : int

Index to the child Node

Return type:

PyNode

Derived from api method maya.OpenMaya.MFnDagNode.child

comp(compName)

Will retrieve a Component object for this node; similar to DependNode.attr(), but for components.

Return type:Component
firstParent()

firstParentOf

Return type:DagNode
firstParent2(**kwargs)
unlike the firstParent command which determines the parent via string formatting, this command uses the listRelatives command
fullPath(stripNamespace=False, levels=0)

The full dag path to the object, including leading pipe ( | )

Return type:unicode
getAllParents()

Return a list of all parents above this.

Starts from the parent immediately above, going up.

Return type:Attribute list
getChildren(**kwargs)

see also childAtIndex

Return type:DagNode list
getInstances(includeSelf=True)
Return type:DagNode list
>>> from pymel.core import *
>>> f=newFile(f=1) #start clean
>>>
>>> s = polyPlane()[0]
>>> instance(s)
[nt.Transform(u'pPlane2')]
>>> instance(s)
[nt.Transform(u'pPlane3')]
>>> s.getShape().getInstances()
[nt.Mesh(u'pPlane1|pPlaneShape1'), nt.Mesh(u'pPlane2|pPlaneShape1'), nt.Mesh(u'pPlane3|pPlaneShape1')]
>>> s.getShape().getInstances(includeSelf=False)
[nt.Mesh(u'pPlane2|pPlaneShape1'), nt.Mesh(u'pPlane3|pPlaneShape1')]
getObjectColor()

Determines the index for the current user defined inactive color used by the node. Valid indices are from 0 to 7.

Return type:int

Derived from api method maya.OpenMaya.MFnDagNode.objectColor

getOtherInstances()

same as DagNode.getInstances with includeSelf=False.

Return type:DagNode list
getParent(generations=1)
Modifications:
  • added optional generations flag, which gives the number of levels up that you wish to go for the parent; ie:

    >>> from pymel.core import *
    >>> select(cl=1)
    >>> bottom = group(n='bottom')
    >>> group(n='almostThere')
    nt.Transform(u'almostThere')
    >>> group(n='nextLevel')
    nt.Transform(u'nextLevel')
    >>> group(n='topLevel')
    nt.Transform(u'topLevel')
    >>> bottom.longName()
    u'|topLevel|nextLevel|almostThere|bottom'
    >>> bottom.getParent(2)
    nt.Transform(u'nextLevel')
    

    Negative values will traverse from the top:

    >>> bottom.getParent(generations=-3)
    nt.Transform(u'almostThere')
    

    A value of 0 will return the same node. The default value is 1.

    Since the original command returned None if there is no parent, to sync with this behavior, None will be returned if generations is out of bounds (no IndexError will be thrown).

Return type:DagNode
getSiblings(**kwargs)
Return type:DagNode list
hasChild(node)

Determines whether or not the given Node is a child of the DAG Node attached to the Function Set.

Parameters:
node : PyNode

node to check

Return type:

bool

Derived from api method maya.OpenMaya.MFnDagNode.hasChild

hasParent(node)

Determines whether or not the given Node is a parent of the DAG Node attached to the Function Set.

Parameters:
node : PyNode

Potential parent node

Return type:

bool

Derived from api method maya.OpenMaya.MFnDagNode.hasParent

inModel()

Determines whether or not the DAG Node is in the model.

Return type:bool

Derived from api method maya.OpenMaya.MFnDagNode.inModel

inUnderWorld()

Determines whether or not the DAG Node is an underworld node. (An example of an underworld node is a curve on surface .)

Return type:bool

Derived from api method maya.OpenMaya.MFnDagNode.inUnderWorld

instanceCount(total=True)

Determines the number of times the Node attached to the Function Set is instanced.

Parameters:
total : bool

Indirect instance flag

Return type:

int

Derived from api method maya.OpenMaya.MFnDagNode.instanceCount

instanceNumber()

returns the instance number that this path represents in the DAG. The instance number can be used to determine which element of the world space array attributes of a DAG node to connect to get information regarding this instance.

Return type:int
isChildOf(node)

Determines whether or not the DAG Node attached to the Function Set is a child of the given node.

Parameters:
node : PyNode

node to check

Return type:

bool

Derived from api method maya.OpenMaya.MFnDagNode.isChildOf

isDisplaced()

Returns whether any of this object’s shading groups have a displacement shader input

Return type:bool
isInstanceOf(other)
Return type:bool
isInstanceable()

Returns true if the DAG node can be instanced, and false otherwise.

Return type:bool

Derived from api method maya.OpenMaya.MFnDagNode.isInstanceable

isInstanced(indirect=True)

Determines whether the DAG Node attached to the Function Set is directly or indirectly instanced.

Parameters:
indirect : bool

Indirect instance flag

Return type:

bool

Derived from api method maya.OpenMaya.MFnDagNode.isInstanced

isIntermediate()

Returns true if this object is an intermediate in a geometry calculation.

Return type:bool

Derived from api method maya.OpenMaya.MFnDagNode.isIntermediateObject

isParentOf(node)

Determines whether or not the DAG Node attached to the Function Set is a parent of the given node.

Parameters:
node : PyNode

node to check

Return type:

bool

Derived from api method maya.OpenMaya.MFnDagNode.isParentOf

isUsingObjectColor()

Determines whether or not the user defined inactive color will be used for the node, or whether the default inactive color will be used.

Return type:bool

Derived from api method maya.OpenMaya.MFnDagNode.usingObjectColor

listRelatives(**kwargs)
Return type:PyNode list
longName(stripNamespace=False, levels=0)

The full dag path to the object, including leading pipe ( | )

Return type:unicode
makeLive(state=True)
name(update=True, long=False)
nodeName()

Just the name of the node, without any dag path

Return type:unicode
numChildren()

Determines the number of child Nodes of the Node. Used to determine the upper bound for the child index (max index = childCount-1).

Return type:int

Derived from api method maya.OpenMaya.MFnDagNode.childCount

parentAtIndex(i)

Queries the DAG Node attached to the Function Set for the parent Node corresponding to the given index.

Parameters:
i : int

Index to the parent Node

Return type:

PyNode

Derived from api method maya.OpenMaya.MFnDagNode.parent

parentCount()

Determines the number of parent Nodes of the Node. Used to determine the upper bound for the parent index (max index = parentCount-1).

Return type:int

Derived from api method maya.OpenMaya.MFnDagNode.parentCount

root()

rootOf

Return type:unicode
setIntermediate(isIntermediate)

Sets whether this object is an intermediate in a geometry calculation.

Parameters:
isIntermediate : bool

whether to make this an intermediate object

Derived from api method maya.OpenMaya.MFnDagNode.setIntermediateObject

setObjectColor(color=None)
This command sets the dormant wireframe color of the specified objects to an integer representing one of the user defined colors, or, if set to None, to the default class color
setParent(*args, **kwargs)

parent

Modifications:
if parent is ‘None’, world=True is automatically set
setUseObjectColor(useObjectColor)

Sets whether or not the user defined inactive object color will be used.

Parameters:
useObjectColor : bool

True means the user defined inactive object color will be used

Derived from api method maya.OpenMaya.MFnDagNode.setUseObjectColor

Undo is not currently supported for this method

shortName()

The shortest unique name.

Return type:unicode
transformationMatrix()

Returns the object space transformation matrix for this DAG node. In general, only transform nodes have matrices associated with them. Nodes such as shapes (geometry nodes) do not have transform matrices.

Return type:Matrix

Derived from api method maya.OpenMaya.MFnDagNode.transformationMatrix

Previous topic

pymel.core.nodetypes.DagContainer

Next topic

pymel.core.nodetypes.DagPose

Core

Core Modules

Other Modules

This Page