pymel.core.general.attributeInfo

attributeInfo(*args, **kwargs)

This command lists all of the attributes that are marked with certain flags. Combinations of flags may be specified and all will be considered. (The method of combination depends on the state of the “logicalAnd/and” flag.) When the “allAttributes/all” flag is specified, attributes of all types will be listed.

Flags:
Long name (short name) Argument Types Properties
allAttributes (all) bool ../../../_images/create.gif
 

Show all attributes associated with the node regardless of type. Use of this flag overrides any other attribute type flags and logical operation that may be specified on the command.

bool (b) bool ../../../_images/create.gif
 
Show the attributes that are of type boolean. Use the ‘on’ state to get only boolean attributes; the ‘off’ state to ignore boolean attributes.
enumerated (e) bool ../../../_images/create.gif
 
Show the attributes that are of type enumerated. Use the ‘on’ state to get only enumerated attributes; the ‘off’ state to ignore enumerated attributes.
hidden (h) bool ../../../_images/create.gif
 
Show the attributes that are marked as hidden. Use the ‘on’ state to get hidden attributes; the ‘off’ state to get non-hidden attributes.
inherited (inherited) bool ../../../_images/create.gif
 

Filter the attributes based on whether they belong to the node type directly or have been inherited from a root type (e.g. meshShape/direct or dagObject/inherited). Use the ‘on’ state to get only inherited attributes, the ‘off’ state to get only directly owned attributes, and leave the flag unspecified to get both.

internal (i) bool ../../../_images/create.gif
 
Show the attributes that are marked as internal to the node. Use the ‘on’ state to get internal attributes; the ‘off’ state to get non-internal attributes.
leaf (l) bool ../../../_images/create.gif
 

Show the attributes that are complex leaves (ie. that have parent attributes and have no children themselves). Use the ‘on’ state to get leaf attributes; the ‘off’ state to get non-leaf attributes.

logicalAnd (logicalAnd) bool ../../../_images/create.gif
 
The default is to take the logical ‘or’ of the above conditions. Specifying this flag switches to the logical ‘and’ instead.
multi (m) bool ../../../_images/create.gif
 
Show the attributes that are multis. Use the ‘on’ state to get multi attributes; the ‘off’ state to get non-multi attributes.
short (s) bool ../../../_images/create.gif
 
Show the short attribute names instead of the long names.
type (t) unicode ../../../_images/create.gif
 

static node type from which to get ‘affects’ informationFlag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

userInterface (ui) bool ../../../_images/create.gif
 
Show the UI-friendly attribute names instead of the Maya ASCII names. Takes precedence over the -s/-short flag if both are specified.
writable (w) bool ../../../_images/create.gif
 

Show the attributes that are writable (ie. can have input connections). Use the ‘on’ state to get writable attributes; the ‘off’ state to get non-writable attributes.

Derived from mel command maya.cmds.attributeInfo

Example:

import pymel.core as pm

import maya.cmds as cmds

pm.createNode( 'choice' )
# Result: nt.Choice(u'choice1') #
# Get the list of only hidden choice node attributes
#
pm.attributeInfo( h=True, t='choice' )
# Result: [u'message', u'isHistoricallyInteresting', u'binMembership'] #
# Get the list of all attributes on choice nodes
pm.attributeInfo( all=True, t='choice' )
# Result: [u'message', u'caching', u'isHistoricallyInteresting', u'nodeState', u'binMembership', u'selector', u'input', u'output', u'sampson', u'homeboy', u'midge', u'damien', u'elizabeth', u'sweetpea'] #
# Get the list of boolean or enumerated transform node attributes
#
pm.attributeInfo( b=True, e=True, t='transform' )
# Result: [u'caching', u'nodeState', u'isCollapsed', u'blackBox', u'isHierarchicalConnection', u'isHierarchicalNode', u'viewMode', u'uiTreatment', u'visibility', u'intermediateObject', u'template', u'ghosting', u'useObjectColor', u'overrideDisplayType', u'overrideLevelOfDetail', u'overrideShading', u'overrideTexturing', u'overridePlayback', u'overrideEnabled', u'overrideVisibility', u'lodVisibility', u'layerRenderable', u'renderLayerRenderable', u'ghostingControl', u'rotateOrder', u'minTransXLimitEnable', u'minTransYLimitEnable', u'minTransZLimitEnable', u'maxTransXLimitEnable', u'maxTransYLimitEnable', u'maxTransZLimitEnable', u'minRotXLimitEnable', u'minRotYLimitEnable', u'minRotZLimitEnable', u'maxRotXLimitEnable', u'maxRotYLimitEnable', u'maxRotZLimitEnable', u'minScaleXLimitEnable', u'minScaleYLimitEnable', u'minScaleZLimitEnable', u'maxScaleXLimitEnable', u'maxScaleYLimitEnable', u'maxScaleZLimitEnable', u'inheritsTransform', u'displayHandle', u'displayScalePivot', u'displayRotatePivot', u'displayLocalAxis', u'dynamics', u'showManipDefault', u'rotationInterpolation', u'miDeriveFromMaya', u'miHide', u'miVisible', u'miTrace', u'miShadow', u'miCaustic', u'miGlobillum', u'miExportGeoShader', u'miProxyRenderable'] #
# Get the list of short names of enumerated attributes on a particular choice
# node.
#
pm.attributeInfo( 'choice1', s=True, e=True )
# Result: [u'nds'] #
# Result: message input output selector
# Get the list of hidden or internal attributes on one particular choice node
# using the UI name for the attributes (that is the one that will show up
# in the attribute editor).
#
pm.attributeInfo( 'choice1', ui=True, h=True, i=True )
# Result: [u'Message', u'Caching', u'Is Historically Interesting', u'Node State', u'Bin Membership'] #

Previous topic

pymel.core.general.assignCommand

Next topic

pymel.core.general.attributeName

Core

Core Modules

Other Modules

This Page