Go to: Synopsis. Return value. Related. Python examples.

Synopsis

renameAttr( nodeName.oldAttrName newAttrName )

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

renameAttr is undoable, queryable, and editable.

Renames the given user-defined attribute from oldName to newName. If the new name conflicts with an existing name then this command will fail.

Note that it is not legal to rename an attribute to the empty string.

Return value

string containing the new name (when undone returns original name)

In query mode, return type is based on queried flag.

Related

addAttr, aliasAttr, attributeInfo, deleteAttr, getClassification, nodeType, objExists, objectType

Python examples

import maya.cmds as cmds

cmds.sphere( n='sph' )
cmds.addAttr( sn='ms', ln='mass', dv=1.0, min=0.001, max=10000 )
cmds.renameAttr( 'sph.mass', 'length' )
cmds.renameAttr( 'sph.ms', 'ln' )