pymel.core.nodetypes.DagNode

digraph inheritance1afa7630c8 { rankdir=TB; ranksep=0.15; nodesep=0.15; size="8.0, 12.0"; "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)"]; "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)"]; "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)"]; "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)"]; "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]; "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)",tooltip="Abstract class that is base for all pymel nodes classes.",height=0.25,shape=box,fontsize=8]; "ProxyUnicode" -> "PyNode" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

class DagNode(*args, **kwargs)
MObjectColorType = Enum( EnumValue('MObjectColorType', 0, 'defaultColor'), EnumValue('MObjectColorType', 1, 'indexColor'), EnumValue('MObjectColorType', 2, 'RGBColor'))
__apihandle__()

get the maya.OpenMaya.MObjectHandle for this node if it is valid

__apimdagpath__()

get the maya.OpenMaya.MDagPath for this object if it is valid

__apiobject__()

get the maya.OpenMaya.MDagPath for this object if it is valid

__or__(child, **kwargs)

operator for addChild. Use to easily daisy-chain together parenting operations. The operation order visually mimics the resulting dag path:

>>> from pymel.core import *
>>> s = polySphere(name='sphere')[0]
>>> c = polyCube(name='cube')[0]
>>> t = polyTorus(name='torus')[0]
>>> s | c | t
nt.Transform(u'torus')
>>> print t.fullPath()
|sphere|cube|torus
Return type:DagNode
activeColor()

Determines the active color used by this node. The active color is the active color for this kind of dag node.

Return type:Color

Derived from api method maya.OpenMaya.MFnDagNode.activeColor

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
dormantColor()
Determines the dormant color used by this node. The order to determine the dormant color is:

hilite color if hilite color is used object color if user defined object color is used the dormant color for this kind of dag node

Parameters:

[out] ReturnStatus Status code.

Returns: The dormant color. Status Codes: MS::kSuccess Success MS::kFailure No valid DAG Node attached to Function Set

Return type:Color

Derived from api method maya.OpenMaya.MFnDagNode.dormantColor

drawOverrideColor()

Determines the draw override color used by this node. Returns true if there is a draw override color. Otherwise, returns false and color parameter is not changed.

Return type:(bool, Color)

Derived from api method maya.OpenMaya.MFnDagNode.drawOverrideColor

drawOverrideEnabled()

Determines whether or not draw override is turned on for this node.

Return type:bool

Derived from api method maya.OpenMaya.MFnDagNode.drawOverrideEnabled

drawOverrideIsReference()

Determines whether or not Display Type of the draw override is Reference for this node.

Return type:bool

Derived from api method maya.OpenMaya.MFnDagNode.drawOverrideIsReference

drawOverrideIsTemplate()

Determines whether or not Display Type of the draw override is Template for this node.

Return type:bool

Derived from api method maya.OpenMaya.MFnDagNode.drawOverrideIsTemplate

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(**kwargs)

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

Returns:
Return type:unicode

Examples

>>> import pymel.core as pm
>>> pm.newFile(f=1)
''
>>> cube1 = pm.polyCube()[0]
>>> cube2 = pm.polyCube()[0]
>>> cube3 = pm.polyCube()[0]
>>> cube3Shape = cube3.getShape()
>>> cube2.setParent(cube1)
nt.Transform(u'pCube2')
>>> cube3.setParent(cube2)
nt.Transform(u'pCube3')
>>> pm.namespace(add='foo')
u'foo'
>>> pm.namespace(add='bar', parent='foo')
u'foo:bar'
>>> pm.namespace(add='stuff', parent='foo:bar')
u'foo:bar:stuff'
>>> cube2.rename(':foo:pCube2')
nt.Transform(u'foo:pCube2')
>>> cube3.rename(':foo:bar:pCube3')
nt.Transform(u'foo:bar:pCube3')
>>> cube3Shape.rename(':foo:bar:stuff:pCubeShape3')
nt.Mesh(u'foo:bar:stuff:pCubeShape3')
>>> cube3Shape.longName()
u'|pCube1|foo:pCube2|foo:bar:pCube3|foo:bar:stuff:pCubeShape3'
>>> cube3Shape.longName(stripNamespace=True)
u'|pCube1|pCube2|pCube3|pCubeShape3'
>>> cube3Shape.longName(stripNamespace=True, levels=1)
u'|pCube1|pCube2|bar:pCube3|bar:stuff:pCubeShape3'
>>> cube3Shape.longName(stripNamespace=True, levels=2)
u'|pCube1|pCube2|pCube3|stuff:pCubeShape3'
>>> cam = pm.camera()[0]
>>> cam.setParent(cube2)
nt.Transform(u'camera1')
>>> imagePlane = pm.imagePlane(camera=cam.getShape())[1]
>>> imagePlane.rename('foo:bar:stuff:imagePlaneShape1')
nt.ImagePlane(u'cameraShape1->foo:bar:stuff:imagePlaneShape1')
>>> imagePlane.longName()
u'|pCube1|foo:pCube2|camera1|cameraShape1->|imagePlane1|foo:bar:stuff:imagePlaneShape1'
>>> imagePlane.longName(stripUnderWorld=True)
u'|imagePlane1|foo:bar:stuff:imagePlaneShape1'
>>> imagePlane.longName(stripNamespace=True, levels=1)
u'|pCube1|pCube2|camera1|cameraShape1->|imagePlane1|bar:stuff:imagePlaneShape1'
>>> imagePlane.longName(stripUnderWorld=True, stripNamespace=True)
u'|imagePlane1|imagePlaneShape1'
getAllParents()

Return a list of all parents above this.

Starts from the parent immediately above, going up.

Return type:DagNode list
getChildren(**kwargs)

see also childAtIndex

for flags, see pymel.core.general.listRelatives

Return type:DagNode list
getConnectedSetsAndMembers(instanceNumber, renderableSetsOnly)

Returns all the sets connected to the specified instance of this DAG object. For each set in the “sets” array there is a corresponding entry in the “comps” array which are all the components in that set. If the entire object is in a set, then the corresponding entry in the comps array will have no elements in it.

Parameters:
instanceNumber : int

The instance number of the mesh to query

renderableSetsOnly : bool

If true then this method will only return renderable sets

Return type:

(PyNode list, PyNode list)

Derived from api method maya.OpenMaya.MFnDagNode.getConnectedSetsAndMembers

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(*args, **kwargs)
getObjectColorType()

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:DagNode.MObjectColorType

Derived from api method maya.OpenMaya.MFnDagNode.objectColorType

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.

    If generations is None, it will be interpreted as ‘return all parents’, and a list will be returned.

    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)

for flags, see pymel.core.general.listRelatives

Return type:DagNode list
hasChild(child)

Modifications: - handles underworld nodes correctly

hasParent(parent)

Modifications: - handles underworld nodes correctly

hide()
hiliteColor()

Determines the current hilite color used by the node.

Return type:Color

Derived from api method maya.OpenMaya.MFnDagNode.hiliteColor

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(parent)

Modifications: - handles underworld nodes correctly

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(child)

Modifications: - handles underworld nodes correctly

isUsingObjectColor(*args, **kwargs)
isVisible(checkOverride=True)
listComp(names=False)

Will return a list of all component objects for this object

Is to .comp() what .listAttr() is to .attr(); will NOT check the shape node.

Parameters:names (bool) – By default, will return a list of actual usabale pymel Component objects; if you just want a list of string names which would be compatible with .comp(), set names to True
listRelatives(**kwargs)

for flags, see pymel.core.general.listRelatives

Return type:PyNode list
longName(**kwargs)

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

Returns:
Return type:unicode

Examples

>>> import pymel.core as pm
>>> pm.newFile(f=1)
''
>>> cube1 = pm.polyCube()[0]
>>> cube2 = pm.polyCube()[0]
>>> cube3 = pm.polyCube()[0]
>>> cube3Shape = cube3.getShape()
>>> cube2.setParent(cube1)
nt.Transform(u'pCube2')
>>> cube3.setParent(cube2)
nt.Transform(u'pCube3')
>>> pm.namespace(add='foo')
u'foo'
>>> pm.namespace(add='bar', parent='foo')
u'foo:bar'
>>> pm.namespace(add='stuff', parent='foo:bar')
u'foo:bar:stuff'
>>> cube2.rename(':foo:pCube2')
nt.Transform(u'foo:pCube2')
>>> cube3.rename(':foo:bar:pCube3')
nt.Transform(u'foo:bar:pCube3')
>>> cube3Shape.rename(':foo:bar:stuff:pCubeShape3')
nt.Mesh(u'foo:bar:stuff:pCubeShape3')
>>> cube3Shape.longName()
u'|pCube1|foo:pCube2|foo:bar:pCube3|foo:bar:stuff:pCubeShape3'
>>> cube3Shape.longName(stripNamespace=True)
u'|pCube1|pCube2|pCube3|pCubeShape3'
>>> cube3Shape.longName(stripNamespace=True, levels=1)
u'|pCube1|pCube2|bar:pCube3|bar:stuff:pCubeShape3'
>>> cube3Shape.longName(stripNamespace=True, levels=2)
u'|pCube1|pCube2|pCube3|stuff:pCubeShape3'
>>> cam = pm.camera()[0]
>>> cam.setParent(cube2)
nt.Transform(u'camera1')
>>> imagePlane = pm.imagePlane(camera=cam.getShape())[1]
>>> imagePlane.rename('foo:bar:stuff:imagePlaneShape1')
nt.ImagePlane(u'cameraShape1->foo:bar:stuff:imagePlaneShape1')
>>> imagePlane.longName()
u'|pCube1|foo:pCube2|camera1|cameraShape1->|imagePlane1|foo:bar:stuff:imagePlaneShape1'
>>> imagePlane.longName(stripUnderWorld=True)
u'|imagePlane1|foo:bar:stuff:imagePlaneShape1'
>>> imagePlane.longName(stripNamespace=True, levels=1)
u'|pCube1|pCube2|camera1|cameraShape1->|imagePlane1|bar:stuff:imagePlaneShape1'
>>> imagePlane.longName(stripUnderWorld=True, stripNamespace=True)
u'|imagePlane1|imagePlaneShape1'
makeLive(state=True)
name(update=True, long=False, stripNamespace=False, levels=0, stripUnderWorld=False)

The name of the node

Parameters:
  • update (bool) – if True, will always query to underlying maya object to get it’s current name (and will therefore detect renames, re-parenting, etc); if False, it will use a cached value if available (which is slightly faster, but may be out of date)
  • long ({True, False, None}) – if True, will include always include the full dag path, starting from the world root, including leading pipe ( | ); if False, will return the shortest-unique path; if None, node names will always be returned without any parents, if if they are not unique
  • stripNamespace (bool) – if True, all nodes will have their namespaces stipped off of them (or a certain number of them, if levels is also used)
  • levels (int) – if stripNamespace is True, then this number will determine the how many namespaces will be removed; if 0 (the default), then all leading namespaces will be removed; otherwise, this value gives the number of left-most levels to strip
  • stripUnderWorld (bool) – if stripUnderWorld is True, and the name has underworld components (ie, topNode|topNodeShape->underWorld|underWorldShape), then only the portion in the “deepest underworld” is returned (ie, underWorld|underWorldShape)
Returns:

Return type:

unicode

Examples

>>> import pymel.core as pm
>>> pm.newFile(f=1)
''
>>> cube1 = pm.polyCube()[0]
>>> cube2 = pm.polyCube()[0]
>>> cube3 = pm.polyCube()[0]
>>> cube3Shape = cube3.getShape()
>>> cube2.setParent(cube1)
nt.Transform(u'pCube2')
>>> cube3.setParent(cube2)
nt.Transform(u'pCube3')
>>> pm.namespace(add='foo')
u'foo'
>>> pm.namespace(add='bar', parent='foo')
u'foo:bar'
>>> pm.namespace(add='stuff', parent='foo:bar')
u'foo:bar:stuff'
>>> cube2.rename(':foo:pCube2')
nt.Transform(u'foo:pCube2')
>>> cube3.rename(':foo:bar:pCube3')
nt.Transform(u'foo:bar:pCube3')
>>> cube3Shape.rename(':foo:bar:stuff:pCubeShape3')
nt.Mesh(u'foo:bar:stuff:pCubeShape3')
>>> cube3Shape.name()
u'foo:bar:stuff:pCubeShape3'
>>> cube3Shape.name(stripNamespace=True)
u'pCubeShape3'
>>> cube3Shape.name(long=True)
u'|pCube1|foo:pCube2|foo:bar:pCube3|foo:bar:stuff:pCubeShape3'
>>> cube3Shape.name(long=True, stripNamespace=True)
u'|pCube1|pCube2|pCube3|pCubeShape3'
>>> cube3Shape.name(long=True, stripNamespace=True, levels=1)
u'|pCube1|pCube2|bar:pCube3|bar:stuff:pCubeShape3'
>>> cube3Shape.name(long=True, stripNamespace=True, levels=2)
u'|pCube1|pCube2|pCube3|stuff:pCubeShape3'
>>> cam = pm.camera()[0]
>>> cam.setParent(cube2)
nt.Transform(u'camera1')
>>> imagePlane = pm.imagePlane(camera=cam.getShape())[1]
>>> imagePlane.rename('foo:bar:stuff:imagePlaneShape1')
nt.ImagePlane(u'cameraShape1->foo:bar:stuff:imagePlaneShape1')
>>> imagePlane.name()
u'cameraShape1->foo:bar:stuff:imagePlaneShape1'
>>> imagePlane.name(stripUnderWorld=True)
u'foo:bar:stuff:imagePlaneShape1'
>>> imagePlane.name(stripNamespace=True, levels=1)
u'cameraShape1->bar:stuff:imagePlaneShape1'
>>> imagePlane.name(stripUnderWorld=True, long=True)
u'|imagePlane1|foo:bar:stuff:imagePlaneShape1'
>>> imagePlane.name(stripUnderWorld=True, stripNamespace=True, long=True)
u'|imagePlane1|imagePlaneShape1'
nodeName(stripUnderWorld=True, **kwargs)

Just the name of the node, without any dag path

Returns:
Return type:unicode

Examples

>>> import pymel.core as pm
>>> pm.newFile(f=1)
''
>>> cube1 = pm.polyCube()[0]
>>> cube2 = pm.polyCube()[0]
>>> cube3 = pm.polyCube()[0]
>>> cube3Shape = cube3.getShape()
>>> cube2.setParent(cube1)
nt.Transform(u'pCube2')
>>> cube3.setParent(cube2)
nt.Transform(u'pCube3')
>>> pm.namespace(add='foo')
u'foo'
>>> pm.namespace(add='bar', parent='foo')
u'foo:bar'
>>> pm.namespace(add='stuff', parent='foo:bar')
u'foo:bar:stuff'
>>> cube2.rename(':foo:pCube2')
nt.Transform(u'foo:pCube2')
>>> cube3.rename(':foo:bar:pCube3')
nt.Transform(u'foo:bar:pCube3')
>>> cube3Shape.rename(':foo:bar:stuff:pCubeShape3')
nt.Mesh(u'foo:bar:stuff:pCubeShape3')
>>> # create an object with the same name as pCube3 / pCube4
>>> cube3Twin = pm.polyCube()[0]
>>> cube3Twin.rename('foo:bar:pCube3')
nt.Transform(u'|foo:bar:pCube3')
>>> cube3ShapeTwin = cube3Twin.getShape()
>>> cube3ShapeTwin.rename('foo:bar:stuff:pCubeShape3')
nt.Mesh(u'|foo:bar:pCube3|foo:bar:stuff:pCubeShape3')
>>> cube3Shape.shortName()
u'foo:pCube2|foo:bar:pCube3|foo:bar:stuff:pCubeShape3'
>>> cube3Shape.nodeName()
u'foo:bar:stuff:pCubeShape3'
>>> cube3Shape.nodeName(stripNamespace=True)
u'pCubeShape3'
>>> cube3Shape.nodeName(stripNamespace=True, levels=1)
u'bar:stuff:pCubeShape3'
>>> cube3Shape.nodeName(stripNamespace=True, levels=2)
u'stuff:pCubeShape3'
>>> cam = pm.camera()[0]
>>> cam.setParent(cube2)
nt.Transform(u'camera1')
>>> imagePlaneTrans, imagePlane = pm.imagePlane(camera=cam.getShape())
>>> imagePlane.rename('foo:bar:stuff:imagePlaneShape1')
nt.ImagePlane(u'cameraShape1->foo:bar:stuff:imagePlaneShape1')
>>> # create an object with the same name as cam
>>> pm.camera()[0].setParent(cube3Twin).rename('camera1')
nt.Transform(u'|foo:bar:pCube3|camera1')
>>> # create an object with the same name as imagePlane
>>> imagePlaneTwinTrans, imagePlaneTwin = pm.imagePlane(camera=cam.getShape())
>>> imagePlaneTwin.rename('foo:bar:stuff:imagePlaneShape1')
nt.ImagePlane(u'foo:pCube2|camera1|cameraShape1->imagePlane2|foo:bar:stuff:imagePlaneShape1')
>>> imagePlane.shortName()
u'foo:pCube2|camera1|cameraShape1->imagePlane1|foo:bar:stuff:imagePlaneShape1'
>>> imagePlane.nodeName()
u'foo:bar:stuff:imagePlaneShape1'
>>> imagePlane.nodeName(stripUnderWorld=False)
u'cameraShape1->foo:bar:stuff:imagePlaneShape1'
>>> imagePlane.nodeName(stripNamespace=True)
u'imagePlaneShape1'
>>> imagePlane.nodeName(stripNamespace=True, levels=1)
u'bar:stuff:imagePlaneShape1'
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

objectColorIndex()

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.objectColorIndex

objectColorRGB()

Determines the RGB color for the current user defined inactive color used by the node.

Return type:Color

Derived from api method maya.OpenMaya.MFnDagNode.objectColorRGB

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

setObjectColorType(type)

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

Parameters:
type : DagNode.MObjectColorType

MFnDagNode::kUseDefaultColor - the color defined in the color preferences will be used. MFnDagNode::kUseIndexColor - the user-defined inactive object indexed color will be used MFnDagNode::kUseRGBColor - the user defined inactive RGB object color will be used

values: ‘defaultColor’, ‘indexColor’, ‘RGBColor’

Derived from api method maya.OpenMaya.MFnDagNode.setObjectColorType

setParent(*args, **kwargs)

parent

Modifications:
  • if parent is ‘None’, world=True is automatically set
  • if the given parent is the current parent, don’t error
setUseObjectColor(*args, **kwargs)
shortName(**kwargs)

The shortest unique name.

Returns:
Return type:unicode

Examples

>>> import pymel.core as pm
>>> pm.newFile(f=1)
''
>>> cube1 = pm.polyCube()[0]
>>> cube2 = pm.polyCube()[0]
>>> cube3 = pm.polyCube()[0]
>>> cube3Shape = cube3.getShape()
>>> cube2.setParent(cube1)
nt.Transform(u'pCube2')
>>> cube3.setParent(cube2)
nt.Transform(u'pCube3')
>>> pm.namespace(add='foo')
u'foo'
>>> pm.namespace(add='bar', parent='foo')
u'foo:bar'
>>> pm.namespace(add='stuff', parent='foo:bar')
u'foo:bar:stuff'
>>> cube2.rename(':foo:pCube2')
nt.Transform(u'foo:pCube2')
>>> cube3.rename(':foo:bar:pCube3')
nt.Transform(u'foo:bar:pCube3')
>>> cube3Shape.rename(':foo:bar:stuff:pCubeShape3')
nt.Mesh(u'foo:bar:stuff:pCubeShape3')
>>> cube3Shape.shortName()
u'foo:bar:stuff:pCubeShape3'
>>> cube3Shape.shortName(stripNamespace=True)
u'pCubeShape3'
>>> cube3Shape.shortName(stripNamespace=True, levels=1)
u'bar:stuff:pCubeShape3'
>>> cube3Shape.shortName(stripNamespace=True, levels=2)
u'stuff:pCubeShape3'
>>> cam = pm.camera()[0]
>>> cam.setParent(cube2)
nt.Transform(u'camera1')
>>> imagePlane = pm.imagePlane(camera=cam.getShape())[1]
>>> imagePlane.rename('foo:bar:stuff:imagePlaneShape1')
nt.ImagePlane(u'cameraShape1->foo:bar:stuff:imagePlaneShape1')
>>> imagePlane.shortName()
u'cameraShape1->foo:bar:stuff:imagePlaneShape1'
>>> imagePlane.shortName(stripUnderWorld=True)
u'foo:bar:stuff:imagePlaneShape1'
>>> imagePlane.shortName(stripNamespace=True, levels=1)
u'cameraShape1->bar:stuff:imagePlaneShape1'
>>> imagePlane.shortName(stripUnderWorld=True)
u'foo:bar:stuff:imagePlaneShape1'
>>> imagePlane.shortName(stripUnderWorld=True, stripNamespace=True)
u'imagePlaneShape1'
show()
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

usingHiliteColor()

Determines whether or not the hilite color will be used for the node. hilite command sets this flag to true.

Return type:bool

Derived from api method maya.OpenMaya.MFnDagNode.usingHiliteColor