This command is used to delete a dynamic attribute from a node or nodes. The attribute can be specified by using either the long or short name. Only one dynamic attribute can be deleted at a time. Static attributes cannot be deleted. Children of a compound attribute cannot be deleted. You must delete the complete compound attribute. This command has no edit capabilities. The only query ability is to list all the dynamic attributes of a node. In query mode, return type is based on queried flag.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
attribute (at) | unicode | ||
Specify either the long or short name of the attribute.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list. |
|||
name (n) | unicode | ||
|
Derived from mel command maya.cmds.deleteAttr
Example:
import pymel.core as pm
import maya.cmds as cmds
pm.createNode( 'planet', n='mars' )
# Result: nt.Unknown(u'mars') #
pm.addAttr( ln='martians', sn='mr', at='double' )
pm.addAttr( ln='greenMen', sn='gm', at='double' )
# Delete an attribute named mr/martians.
pm.deleteAttr( 'mars', at='mr' )
# Alternative syntax
pm.deleteAttr( 'mars.greenMen' )
# Query for the list of dynamic attributes.
pm.deleteAttr( 'mars', q=True )