pymel.core.animation.mirrorJoint

mirrorJoint(*args, **kwargs)

This command will duplicate a branch of the skeleton from the selected joint symmetrically about a plane in world space. There are three mirroring modes(xy-, yz-, xz-plane).

Flags:

Long Name / Short Name Argument Types Properties
mirrorBehavior / mb bool ../../../_images/create.gif
  The mirrorBehavior flag is used to specify that when performing the mirror, the joint orientation axes should be mirrored such that equal rotations on the original and mirrored joints will place the skeleton in a mirrored position (symmetric across the mirroring plane). Thus, animation curves from the original joints can be copied to the mirrored side to produce a similar (but symmetric) behavior. When mirrorBehavior is not specified, the joint orientation on the mirrored side will be identical to the source side.
mirrorXY / mxy bool ../../../_images/create.gif
  mirror skeleton from the selected joint about xy-plane in world space.
mirrorXZ / mxz bool ../../../_images/create.gif
  mirror skeleton from the selected joint about xz-plane in world space.
mirrorYZ / myz bool ../../../_images/create.gif
  mirror skeleton from the selected joint about yz-plane in world space.
searchReplace / sr unicode, unicode ../../../_images/create.gif
  After performing the mirror, rename the new joints by searching the name for the first specified string and replacing it with the second specified string. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.mirrorJoint

Example:

import pymel.core as pm

# Create a mirrored branch of the skeleton starting from the joint "jointName"
# about the yz-plane.
# Joint orientations on the mirrored side will be identical to the source side.
#
pm.mirrorJoint( 'jointName' )

# Create a mirrored branch of the skeleton starting from the joint "jointName"
# about the yz-plane.
# Joint orientations on the mirrored side will be mirrored from the source side.
#
pm.mirrorJoint('jointName',mirrorBehavior=True,myz=True)

# Create a mirrored branch of the skeleton starting from the selected joint
# about the xy-plane.
# Joint orientations on the mirrored side will be mirrored from the source side.
# Joint names on the duplicated side will contain the string "right_" if
# the corresponding joint on the original side contained the string "left_".
#
pm.mirrorJoint(mirrorXY=True,mirrorBehavior=True,searchReplace=('left_', 'right_') )