Go to: Synopsis. Return value. Keywords. Related. Flags. Python examples.
characterMap([mapAttr=[string, string]], [mapMethod=string], [mapNode=[string, string]], [mapping=string], [proposedMapping=boolean], [unmapAttr=[string, string]], [unmapNode=[string, string]])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
characterMap is undoable, queryable, and editable.
This command is used to create a correlation between the attributes of 2 or more characters.
In query mode, return type is based on queried flag.
character, clip, animation
bakeClip, character, clip, clipEditor, clipSchedule
mapAttr, mapMethod, mapNode, mapping, proposedMapping, unmapAttr, unmapNode
Long name (short name) |
Argument types |
Properties |
mapAttr(ma)
|
[string, string]
|
|
|
In query mode, this flag can be used to query the mapping stored by the specified map node. It returns an array of strings.
In non-query mode, this flag can be used to create a mapping between the specified character members. Any previous mapping on the attributes is removed in favor of the newly specified mapping.
|
|
unmapAttr(ua)
|
[string, string]
|
|
|
This flag can be used to unmap the mapping stored by the specified map node.
|
|
mapping(m)
|
string
|
|
|
This flag is valid in query mode only. It must be used before the query flag with a string argument. It is used for querying the mapping for a particular attribute. A string array is returned.
|
|
proposedMapping(pm)
|
boolean
|
|
|
This flag is valid in query mode only. It is used to get an array of the mapping that the character map would prvide if called with the specified characters and the (optional) specified mappingMethod. If a character map exists on the characters, the map is not affected by the query operation. A string array is returned.
|
|
mapMethod(mm)
|
string
|
|
|
This is is valid in create mode only. It specifies how the mapping should be done. Valid options are: "byNodeName", "byAttrName", and "byAttrOrder". "byAttrOrder" is the default. The flags mean the following: "byAttrOrder" maps using the order that the character stores the attributes internally, "byAttrName" uses the attribute name to find a correspondence, "byNodeName" uses the node name *and* the attribute name to find a correspondence.
|
|
mapNode(mn)
|
[string, string]
|
|
|
This flag can be used to map all the attributes on the source node to their matching attributes on the destination node.
|
|
unmapNode(umn)
|
[string, string]
|
|
|
This flag can be used to unmap all the attributes on the source node to their matching attributes on the destination node. Note that mapped attributes which do not have matching names, will not be unmapped.
|
|
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
# Create a mapping between character1 and character2, or if a map already
# exists, update the mapping between any unmapped members.
#
cmds.characterMap( 'character1', 'character2' )
# Query as to whether a mapping exists between two characters
#
cmds.characterMap( 'character1', 'character2', query=True )
# Query which attributes are mapped between two characters
#
cmds.characterMap( 'character1', 'character2', query=True, mapAttr=True )
# Delete the mapping between two pairs of attributes. If no mapping
# exists between the attributes, nothing will happen.
#
cmds.characterMap( 'character1', 'character2', unmapAttr=('sphere1.tx','sphere2.tx') )
# Add a mapping between two attributes. Only attributes that
# are members of characters can be mapped.
#
cmds.characterMap( 'character1', 'character2', mapAttr=('sphere1.tx','sphere2.tx') )
# Query what attribute(s) are mapped to sphere1.tx between character1 and
# character2
#
cmds.characterMap( 'character1', 'character2', mapping='sphere1.tx' )