Copy Skin Weights in Maya Script

Hey Guys,

I’m trying to copy skin weights from one mesh <source> to several other meshes <target_geo> in Maya. I’m not getting any errors, but the script isn’t working. Any thoughts?..

for each in target_geo:
        print "This is geo piece: %s" % each
        mc.select('source', r=True)
        cmds.select (each, add=True)
        mc.ls (selection=True)
        mc.copySkinWeights (nr=True)
        print ('Weighting Copied...')
        mc.select (cl=True)
        print ('reset...')

Thx.

My copySkinWeights command needed more flags… I added the following:

mc.copySkinWeights (nm=True, sa='closestPoint', ia='closestJoint', nr=True)

Good to go!