Skip to content

Instantly share code, notes, and snippets.

@hotcakesdeluxe
Created January 16, 2019 20:52
Show Gist options
  • Save hotcakesdeluxe/6d401074baef43161e6ae97338867e02 to your computer and use it in GitHub Desktop.
Save hotcakesdeluxe/6d401074baef43161e6ae97338867e02 to your computer and use it in GitHub Desktop.
Gets the positions of points of a curve in Maya and gives you a string to replicate that shape using the curve command
import maya.cmds as cmds
sel = cmds.ls(sl=True)
curve = cmds.ls(sel[0]+'.cv[0:]', fl = True)
cmds.select(curve)
pos = []
for i, cv in enumerate(curve):
cvpos = (cmds.pointPosition(cv, l = True))
pos.append(cvpos)
pointString = str(pos)
pointString = pointString.replace('[','(')
pointString = pointString.replace(']',')')
print pointString
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment