pymel.core.other.AttributeName

Inheritance diagram of AttributeName

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(u’lambert1.groupNodes’)

attrItemReg = <_sre.SRE_Pattern object at 0x14a151dd8>
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(u'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(u'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(u'foo:bar')
nodeName()

basename

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

Previous topic

pymel.core.other.webViewCmd

Next topic

pymel.core.other.DagNodeName

Core

Core Modules

Other Modules

This Page