Maya Python – Mirror CVs

This script takes two identical controls and mirrors them across the X axis. This is useful if you have a NURBs control on the left side that you’ve tweaked and want to update the right side control.

def CVList(obj):
	for CV in obj: (obj +'.cv[*]'), fl=True)
	return lCVs
def MirrorCVs(): #select obj then target
	sel =
	#get list of cvs from obj1
	obj1 = sel[0]
	obj2 = sel[1]
	lCVs = CVList(obj1)
	dCVs = {} #build dictionary from cv# and translation from obj1
	for cv in lCVs:
		CVTrans = cmds.xform(cv, query=True, ws= True, translation = True)   
		dCVs[cv] = (-CVTrans[0], CVTrans[1], CVTrans[2])
	lObj2 = CVList(obj2) #iterate thru cvs of obj2 & apply translations
	for i, val in enumerate(lObj2): #apply translation to 2nd obj
		cmds.xform(val, ws=True, translation = dCVs[lCVs[i]])
def Main():

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>