Go to: Synopsis. Return value. Keywords. Related. Flags. Python examples.
attributeName([leaf=boolean], [long=boolean], [nice=boolean], [short=boolean])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
attributeName is NOT undoable, NOT queryable, and NOT editable.
This command takes one "node.attribute"-style specifier on the command line
and returns either the attribute's long, short, or nice name. (The "nice" name,
or UI name, is the name used to display the attribute in Maya's interface, and
may be localized when running Maya in a language other than English.)
If more than one "node.attribute" specifier is given on the command line,
only the first valid specifier is processed.
query, attribute, nice, name
attributeInfo, attributeQuery
leaf, long, nice, short
Long name (short name) |
Argument types |
Properties |
leaf(lf)
|
boolean
|
|
|
When false, shows parent multi attributes (like
"controlPoints[2].xValue"). When true, shows only the
leaf-level attribute name (like "xValue"). Default is true.
Note that for incomplete attribute strings, like a missing
multi-parent index ("controlPoints.xValue") or an
incorrectly named compound (cntrlPnts[2].xValue), this
flag defaults to true and provides a result as long as the
named leaf-level attribute is defined for the node.
|
|
long(l)
|
boolean
|
|
|
Returns names in "long name" format like "translateX"
|
|
nice(n)
|
boolean
|
|
|
Returns names in "nice name" format like "Translate X"
|
|
short(s)
|
boolean
|
|
|
Returns names in "short name" format like "tx"
|
|
Flag can appear in Create mode of command
|
Flag can appear in Edit mode of command
|
Flag can appear in Query mode of command
|
Flag can have multiple arguments, passed either as a tuple or a list.
|
import maya.cmds as cmds
import maya.cmds as cmds
cmds.attributeName( "persp.tx" )
# Result: Translate X #
cmds.attributeName( "persp.translateX", s=True )
# Result: tx #
cmds.attributeName( "persp.tx", l=True )
# Result: translateX #
cmds.attributeName( "nurbsSphere1.controlPoints[50].xv", leaf=True )
// Result: xValue //
cmds.attributeName( "nurbsSphere1.controlPoints[50].xv", leaf=False )
// Result: Control Points[50].X Value //