pymel.core.general.aliasAttr

aliasAttr(*args, **kwargs)

Allows aliases (alternate names) to be defined for any attribute of a specified node. When an attribute is aliased, the alias will be used by the system to display information about the attribute. The user may, however, freely use either the alias or the original name of the attribute. Only a single alias can be specified for an attribute so setting an alias on an already-aliased attribute destroys the old alias.

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

Specifies that aliases listed should be removed (otherwise new aliases are added).Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.aliasAttr

Example:

import pymel.core as pm

pm.createNode( 'blendShape', n='blender' )
# Result: nt.BlendShape(u'blender') #
#
# Define intuitive names for the weights of a blendShape.
# The blendShape command does this automatically to allow you
# to refer to the weight corresponding to a target shape by the name
# of that shape.
#
pm.aliasAttr( 'smile', 'blender.w[0]', 'frown', 'blender.w[1]' )
# Result: 2 #
#
# List all the attribute aliases for the node blendShape1
#
pm.aliasAttr( 'blender', query=True )
# Result: [u'smile', u'weight[0]', u'frown', u'weight[1]'] #
#
# Allow the X rotation on a joint to be called its "roll"
#
pm.createNode( 'joint', n='elbow' )
# Result: nt.Joint(u'elbow') #
pm.aliasAttr( 'roll', 'elbow.rx' )
# Result: 1 #
pm.aliasAttr( 'tuck', 'elbow.ry' )
# Result: 1 #
#
# Remove the roll alias defined above.
#
pm.aliasAttr( 'elbow.roll', rm=True )
#
# Remove the tuck alias defined above.
#
pm.aliasAttr( 'elbow.ry', rm=True )

Previous topic

pymel.core.general.affects

Next topic

pymel.core.general.align

Core

Core Modules

Other Modules

This Page