Skip to content

Instantly share code, notes, and snippets.

@fereria
Created March 14, 2014 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fereria/9547550 to your computer and use it in GitHub Desktop.
Save fereria/9547550 to your computer and use it in GitHub Desktop.
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