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.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
destinationDeformer (dd) | unicode | ||
|
|||
destinationShape (ds) | unicode | ||
|
|||
mirrorInverse (mi) | bool | ||
|
|||
mirrorMode (mm) | unicode | ||
|
|||
noMirror (nm) | bool | ||
|
|||
smooth (sm) | bool | ||
|
|||
sourceDeformer (sd) | unicode | ||
|
|||
sourceShape (ss) | unicode | ||
|
|||
surfaceAssociation (sa) | unicode | ||
The surfaceAssociation flag controls how the weights are transferred between the surfaces: closestPoint, rayCast, or closestComponent. The default is closestComponent. |
|||
uvSpace (uv) | unicode, unicode | ||
The uvSpace flag indicates that the weight transfer should occur in UV space, based on the source and destination UV sets specified. Flag can have multiple arguments, passed either as a tuple or a list. |
Derived from mel command maya.cmds.copyDeformerWeights
Example:
import pymel.core as pm
# Create plane and a cluster.
#
pm.file( f=True,new=True )
pm.polyPlane( ch=1, w=10, h=10, sx=5, sy=5, ax=(0,1,0) )
pm.cluster( n='testCluster', 'pPlane1' )
# Modify some weights on the -x side of the character
#
pm.select( ['pPlane1.vtx[0]', 'pPlane1.vtx[6]', 'pPlane1.vtx[12]', 'pPlane1.vtx[18]'])
pm.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.
#
pm.copyDeformerWeights( ss='pPlane1', ds='pPlane1', sd='testCluster', mirrorMode='YZ', mirrorInverse = True)
pm.select( ['pPlane1.vtx[5]', 'pPlane1.vtx[11]', 'pPlane1.vtx[17]', 'pPlane1.vtx[23]'])
pm.percent( 'testCluster', q=True, v=True )