Go to: Synopsis. Return value. Related. Flags. Python examples.
listAttr(
[objects]
, [array=boolean], [attributeType=string], [caching=boolean], [category=string], [changedSinceFileOpen=boolean], [channelBox=boolean], [connectable=boolean], [extension=boolean], [fromPlugin=boolean], [fullNodeName=boolean], [hasData=boolean], [hasNullData=boolean], [inUse=boolean], [keyable=boolean], [leaf=boolean], [locked=boolean], [multi=boolean], [nodeName=boolean], [output=boolean], [ramp=boolean], [read=boolean], [readOnly=boolean], [scalar=boolean], [scalarAndArray=boolean], [settable=boolean], [shortNames=boolean], [string=string], [unlocked=boolean], [usedAsFilename=boolean], [userDefined=boolean], [visible=boolean], [write=boolean])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
listAttr is undoable, NOT queryable, and NOT editable.
This command lists the attributes of a node. If no flags are specified all attributes are listed.string[] | : List of attributes matching criteria |
Long name (short name) | Argument types | Properties | ||
---|---|---|---|---|
array(a)
|
boolean
|
|||
|
||||
attributeType(at) 2024
|
string
|
|||
|
||||
caching(ca)
|
boolean
|
|||
|
||||
category(ct)
|
string
|
|||
|
||||
changedSinceFileOpen(cfo)
|
boolean
|
|||
|
||||
channelBox(cb)
|
boolean
|
|||
|
||||
connectable(c)
|
boolean
|
|||
|
||||
extension(ex)
|
boolean
|
|||
|
||||
fromPlugin(fp)
|
boolean
|
|||
|
||||
fullNodeName(fnn) 2024
|
boolean
|
|||
|
||||
hasData(hd)
|
boolean
|
|||
|
||||
hasNullData(hnd)
|
boolean
|
|||
|
||||
inUse(iu)
|
boolean
|
|||
|
||||
keyable(k)
|
boolean
|
|||
|
||||
leaf(lf)
|
boolean
|
|||
|
||||
locked(l)
|
boolean
|
|||
|
||||
multi(m)
|
boolean
|
|||
|
||||
nodeName(nn) 2024
|
boolean
|
|||
|
||||
output(o)
|
boolean
|
|||
|
||||
ramp(ra)
|
boolean
|
|||
|
||||
read(r)
|
boolean
|
|||
|
||||
readOnly(ro)
|
boolean
|
|||
|
||||
scalar(s)
|
boolean
|
|||
|
||||
scalarAndArray(sa)
|
boolean
|
|||
|
||||
settable(se)
|
boolean
|
|||
|
||||
shortNames(sn)
|
boolean
|
|||
|
||||
string(st)
|
string
|
|||
|
||||
unlocked(u)
|
boolean
|
|||
|
||||
usedAsFilename(uf)
|
boolean
|
|||
|
||||
userDefined(ud)
|
boolean
|
|||
|
||||
visible(v)
|
boolean
|
|||
|
||||
write(w)
|
boolean
|
|||
|
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 cmds.sphere() cmds.listAttr( r=True, s=True ) # This will list the scalar readable attributes of the # selected nodes. If more than one node is selected attributes # may be listed several times. cmds.listAttr( s=True, r=True, w=True, c=True, st=['centerX','centerY'] ) # This will list all scalar, readable, writable, and connectable # attributes whose names are "centerX" or "centerY". cmds.listAttr( r=True, st='center*', ct='a*' ) # 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". cmds.listAttr( 'nurbsSphere1', s=True, cfo=True ) # 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.