mirrorObject

Simple script for mirroring an object in Maya with python

##
## mirrorObject
## -------------
## 14 jul 2009
## Jan-Erik "Jonne" Östman (jonne@jonne.net)
##
## www.jonne.net
##
##
## Instructions:
## -------------
## Simple script for mirroring an object
## Pythonscript.
##
## ---------------------------------------------------------------------------


import maya.cmds as cmds

# Group and center pivot to origo
sel = cmds.ls(sl=1)

# Duplicate and group selected object
mirrorGRP = cmds.group(cmds.duplicate(sel, rr=1))

#Move pivot to 0,0 and mirror group along the X axis
cmds.xform(ws=1, os=1, piv=(0,0,0) )
cmds.setAttr(mirrorGRP + '.scaleX', -1)
cmds.ungroup(mirrorGRP)



I wish to do something Great and Wonderful, but I must start by doing the little things like they were Great and Wonderful”
~ Albert Einstein