Created
January 16, 2019 20:52
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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