Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Mesh->Curve
import pymel.core as pm
def meshToCurve():
selectMesh = pm.ls(sl=True)
for mesh in selectMesh:
grp = pm.group(em=True,n=mesh.name()+"_Grp")
mesh = mesh.getShape()
faceCount = mesh.numFaces()
for i in range(0,faceCount):
edge = mesh.f[i].getEdges()
pm.select(cl=True)
for j in edge:
mesh.e[j].select(add=True)
cv = pm.polyToCurve(degree=1)
pm.parent(cv[0],grp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment