pymel.core.other.AttributeName

digraph inheritancea3bc8179f1 {
rankdir=TB;
ranksep=0.15;
nodesep=0.15;
size="8.0, 12.0";
  "AttributeName" [fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,URL="#pymel.core.other.AttributeName",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8];
  "NameParser" -> "AttributeName" [arrowsize=0.5,style="setlinewidth(0.5)"];
  "NameParser" [fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,URL="pymel.core.other.NameParser.html#pymel.core.other.NameParser",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8];
}

class AttributeName(attrName)
add(**kwargs)
addAttr(**kwargs)
array()
Returns the array (multi) AttributeName of the current element
>>> n = AttributeName('lambert1.groupNodes[0]')
>>> n.array()
AttributeName('lambert1.groupNodes')
exists()
getParent(generations=1)

Returns the parent attribute

Modifications:
  • added optional generations flag, which gives the number of levels up that you wish to go for the parent; ie:

    >>> AttributeName("Cube1.multiComp[3].child.otherchild").getParent(2)
    AttributeName('Cube1.multiComp[3]')
    

    Negative values will traverse from the top, not counting the initial node name:

    >>> AttributeName("Cube1.multiComp[3].child.otherchild").getParent(-2)
    AttributeName('Cube1.multiComp[3].child')
    

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

item(asSlice=False, asString=False)
lastPlugAttr()
>>> NameParser('foo:bar.spangle.banner').lastPlugAttr()
u'banner'
node()

plugNode

>>> NameParser('foo:bar.spangle.banner').plugNode()
DependNodeName('foo:bar')
nodeName()
basename
plugAttr()

plugAttr

>>> NameParser('foo:bar.spangle.banner').plugAttr()
u'spangle.banner'
plugNode()

plugNode

>>> NameParser('foo:bar.spangle.banner').plugNode()
DependNodeName('foo:bar')
set(*args, **kwargs)
setAttr(*args, **kwargs)

Previous topic

pymel.core.other.testPassContribution

Next topic

pymel.core.other.DagNodeName

Core

Core Modules

Other Modules

This Page