Skip to content

Instantly share code, notes, and snippets.

@tokejepsen
Created November 7, 2013 01:22
Show Gist options
  • Save tokejepsen/7347327 to your computer and use it in GitHub Desktop.
Save tokejepsen/7347327 to your computer and use it in GitHub Desktop.
copy curves
import maya.cmds as cmds
def copyCurve(src,trg):
cvs=cmds.getAttr(src+'.spans')+1
for count in range(0,cvs):
srcCv=cmds.getAttr(src+'.cv[%s]' % count)[0]
cmds.move(srcCv[0], srcCv[1], srcCv[2], trg+'.cv[%s]' % count,os=True)
ns='rig:'
for node in cmds.ls(selection=True):
if cmds.objExists(ns+node):
copyCurve(node,ns+node)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment