Returns the array (multi) AttributeName of the current element >>> n = AttributeName(‘lambert1.groupNodes[0]’) >>> n.array() AttributeName(u’lambert1.groupNodes’)
Returns the parent attribute
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).
>>> NameParser('foo:bar.spangle.banner').lastPlugAttr()
u'banner'
plugNode
>>> NameParser('foo:bar.spangle.banner').plugNode()
DependNodeName(u'foo:bar')
basename
>>> NameParser('foo:bar.spangle.banner').plugAttr()
u'spangle.banner'
>>> NameParser('foo:bar.spangle.banner').plugNode()
DependNodeName(u'foo:bar')