This command lists the attributes of a node. If no flags are specified all attributes are listed.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
array (a) | bool | ![]() |
|
|
|||
caching (ca) | bool | ![]() |
|
|
|||
category (ct) | unicode | ![]() |
|
|
|||
changedSinceFileOpen (cfo) | bool | ![]() |
|
Only list the attributes that have been changed since the file they came from was opened. Typically useful only for objects/attributes coming from referenced files. |
|||
channelBox (cb) | bool | ![]() |
|
|
|||
connectable (c) | bool | ![]() |
|
|
|||
extension (ex) | bool | ![]() |
|
|
|||
fromPlugin (fp) | bool | ![]() |
|
|
|||
hasData (hd) | bool | ![]() |
|
|
|||
hasNullData (hnd) | bool | ![]() |
|
list only attributes that have null data. This will list all attributes that have data (see hasData flag) but the data value is uninitialized. A common example where an attribute may have null data is when a string attribute is created but not yet assigned an initial value. Similarly array attribute data is often null until it is initialized. |
|||
inUse (iu) | bool | ![]() |
|
only show attributes that are currently marked as in use. This flag indicates that an attribute affects the scene data in some way. For example it has a non- default value or it is connected to another attribute. This is the general concept though the precise implementation is subject to change. |
|||
keyable (k) | bool | ![]() |
|
|
|||
leaf (lf) | bool | ![]() |
|
|
|||
locked (l) | bool | ![]() |
|
|
|||
multi (m) | bool | ![]() |
|
|
|||
output (o) | bool | ![]() |
|
|
|||
ramp (ra) | bool | ![]() |
|
|
|||
read (r) | bool | ![]() |
|
|
|||
readOnly (ro) | bool | ![]() |
|
|
|||
scalar (s) | bool | ![]() |
|
|
|||
scalarAndArray (sa) | bool | ![]() |
|
|
|||
settable (se) | bool | ![]() |
|
|
|||
shortNames (sn) | bool | ![]() |
|
|
|||
string (st) | unicode | ![]() |
|
|
|||
unlocked (u) | bool | ![]() |
|
|
|||
usedAsFilename (uf) | bool | ![]() |
|
list only attributes which are designated to be treated as filenamesFlag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list. |
|||
userDefined (ud) | bool | ![]() |
|
|
|||
visible (v) | bool | ![]() |
|
|
|||
write (w) | bool | ![]() |
|
|
Derived from mel command maya.cmds.listAttr
Example:
import pymel.core as pm
import maya.cmds as cmds
pm.sphere()
# Result: [nt.Transform(u'nurbsSphere1'), nt.MakeNurbSphere(u'makeNurbSphere1')] #
pm.listAttr( r=True, s=True )
# Result: [u'caching', u'isHistoricallyInteresting', u'nodeState', u'isCollapsed', u'blackBox', u'isHierarchicalConnection', u'publishedNodeInfo.isHierarchicalNode', u'viewMode', u'templateVersion', u'uiTreatment', u'boundingBoxMinX', u'boundingBoxMinY', u'boundingBoxMinZ', u'boundingBoxMaxX', u'boundingBoxMaxY', u'boundingBoxMaxZ', u'boundingBoxSizeX', u'boundingBoxSizeY', u'boundingBoxSizeZ', u'boundingBoxCenterX', u'boundingBoxCenterY', u'boundingBoxCenterZ', u'visibility', u'intermediateObject', u'template', u'ghosting', u'instObjGroups.objectGroups.objectGroupId', u'instObjGroups.objectGroups.objectGrpColor', u'useObjectColor', u'objectColor', u'overrideDisplayType', u'overrideLevelOfDetail', u'overrideShading', u'overrideTexturing', u'overridePlayback', u'overrideEnabled', u'overrideVisibility', u'overrideColor', u'lodVisibility', u'identification', u'layerRenderable', u'layerOverrideColor', u'renderLayerInfo.renderLayerId', u'renderLayerInfo.renderLayerRenderable', u'renderLayerInfo.renderLayerColor', u'ghostingControl', u'ghostPreSteps', u'ghostPostSteps', u'ghostStepSize', u'ghostColorPreA', u'ghostColorPreR', u'ghostColorPreG', u'ghostColorPreB', u'ghostColorPostA', u'ghostColorPostR', u'ghostColorPostG', u'ghostColorPostB', u'ghostRangeStart', u'ghostRangeEnd', u'bess', u'les', u'wes', u'translateX', u'translateY', u'translateZ', u'rotateX', u'rotateY', u'rotateZ', u'rotateOrder', u'scaleX', u'scaleY', u'scaleZ', u'shearXY', u'shearXZ', u'shearYZ', u'rotatePivotX', u'rotatePivotY', u'rotatePivotZ', u'rotatePivotTranslateX', u'rotatePivotTranslateY', u'rotatePivotTranslateZ', u'scalePivotX', u'scalePivotY', u'scalePivotZ', u'scalePivotTranslateX', u'scalePivotTranslateY', u'scalePivotTranslateZ', u'rotateAxisX', u'rotateAxisY', u'rotateAxisZ', u'transMinusRotatePivotX', u'transMinusRotatePivotY', u'transMinusRotatePivotZ', u'minTransXLimit', u'minTransYLimit', u'minTransZLimit', u'maxTransXLimit', u'maxTransYLimit', u'maxTransZLimit', u'minTransXLimitEnable', u'minTransYLimitEnable', u'minTransZLimitEnable', u'maxTransXLimitEnable', u'maxTransYLimitEnable', u'maxTransZLimitEnable', u'minRotXLimit', u'minRotYLimit', u'minRotZLimit', u'maxRotXLimit', u'maxRotYLimit', u'maxRotZLimit', u'minRotXLimitEnable', u'minRotYLimitEnable', u'minRotZLimitEnable', u'maxRotXLimitEnable', u'maxRotYLimitEnable', u'maxRotZLimitEnable', u'minScaleXLimit', u'minScaleYLimit', u'minScaleZLimit', u'maxScaleXLimit', u'maxScaleYLimit', u'maxScaleZLimit', u'minScaleXLimitEnable', u'minScaleYLimitEnable', u'minScaleZLimitEnable', u'maxScaleXLimitEnable', u'maxScaleYLimitEnable', u'maxScaleZLimitEnable', u'selectHandleX', u'selectHandleY', u'selectHandleZ', u'inheritsTransform', u'displayHandle', u'displayScalePivot', u'displayRotatePivot', u'displayLocalAxis', u'showManipDefault', u'rotateQuaternionX', u'rotateQuaternionY', u'rotateQuaternionZ', u'rotateQuaternionW', u'rotationInterpolation', u'miDeriveFromMaya', u'miHide', u'miVisible', u'miTrace', u'miShadow', u'miCaustic', u'miGlobillum', u'miExportGeoShader', u'miProxyRenderable'] #
# This will list the scalar readable attributes of the
# selected nodes. If more than one node is selected attributes
# may be listed several times.
pm.listAttr( s=True, r=True, w=True, c=True, st=['centerX','centerY'] )
# Result: [] #
# This will list all scalar, readable, writable, and connectable
# attributes whose names are "centerX" or "centerY".
pm.listAttr( r=True, st='center*', ct='a*' )
# Result: [] #
# This will list all readable attributes whose names match
# "center*" (e.g. "centerX" or "centerpede") and who belong to
# a category starting with the letter "a".
pm.listAttr( 'nurbsSphere1', s=True, cfo=True )
# Result: [] #
# This will list all scalar attributes of
# nurbsSphere1 that have been changed since the
# file in which nurbsSphere1 is defined has been
# opened. If nurbsSphere1 comes from a referenced file,
# the result will be all the attributes that have changed
# since the referenced file was opened.