Go to: Synopsis. Return value. Keywords. Flags. Python examples.

Synopsis

copyDeformerWeights([destinationDeformer=string], [destinationShape=string], [mirrorInverse=boolean], [mirrorMode=string], [noMirror=boolean], [smooth=boolean], [sourceDeformer=string], [sourceShape=string], [surfaceAssociation=string], [uvSpace=[string, string]])

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

copyDeformerWeights is undoable, queryable, and editable.

Command to copy or mirror the deformer weights accross one of the three major axes. The command can be used to mirror weights either from one surface to another or within the same surface.

Return value

none

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

Keywords

deformer, duplicate, mirror

Flags

destinationDeformer, destinationShape, mirrorInverse, mirrorMode, noMirror, smooth, sourceDeformer, sourceShape, surfaceAssociation, uvSpace
Long name (short name) Argument types Properties
sourceShape(ss) string createqueryedit
Specify the source deformed shape
destinationShape(ds) string createqueryedit
Specify the destination deformed shape
sourceDeformer(sd) string createqueryedit
Specify the deformer whose weights should be mirrored. When queried, returns the deformers used by the source shapes.
destinationDeformer(dd) string createqueryedit
Specify the deformer used by the destination shape
noMirror(nm) boolean createqueryedit
When the no mirror flag is used, the weights are copied instead of mirrored.
mirrorInverse(mi) boolean createqueryedit
Values are mirrored from the positive side to the negative. If this flag is used then the direction is inverted.
smooth(sm) boolean createqueryedit
When the smooth flag is used, the weights are smoothly interpolated between the closest vertices, instead of assigned from the single closest.
mirrorMode(mm) string createqueryedit
The mirrorMode flag defines the plane of mirroring (XY, YZ, or XZ) when the mirror flag is used. The default plane is XY.
surfaceAssociation(sa) string createqueryedit
The surfaceAssociation flag controls how the weights are transferred between the surfaces: "closestPoint", "rayCast", or "closestComponent". The default is closestComponent.
uvSpace(uv) [string, string] createqueryedit
The uvSpace flag indicates that the weight transfer should occur in UV space, based on the source and destination UV sets specified.

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.

Python examples

import maya.cmds as cmds

# Create plane and a cluster.
#
cmds.file( f=True,new=True )
cmds.polyPlane( ch=1, w=10, h=10, sx=5, sy=5, ax=(0,1,0) )
cmds.cluster( n='testCluster', 'pPlane1' )
# Modify some weights on the -x side of the character
#
cmds.select( ['pPlane1.vtx[0]', 'pPlane1.vtx[6]', 'pPlane1.vtx[12]', 'pPlane1.vtx[18]'])
cmds.percent( 'testCluster', v='0.5' )
# Mirror the skin weights to the other side of the character
# Mirror inverse is chosen since we want to go from -x to +x, not +x to -x.
#
cmds.copyDeformerWeights( ss='pPlane1', ds='pPlane1', sd='testCluster', mirrorMode='YZ', mirrorInverse = True)
cmds.select( ['pPlane1.vtx[5]', 'pPlane1.vtx[11]', 'pPlane1.vtx[17]', 'pPlane1.vtx[23]'])
cmds.percent( 'testCluster', q=True, v=True )