Skip to content

Instantly share code, notes, and snippets.

@SEVEZ
Created August 29, 2015 11:18
Show Gist options
  • Save SEVEZ/57ddf256be03930e559b to your computer and use it in GitHub Desktop.
Save SEVEZ/57ddf256be03930e559b to your computer and use it in GitHub Desktop.
Extract selected edges to curves
from pymel.all import *
sel = ls( selected(), fl=1 )
aCe = []
while len( sel ):
ce = []
for e in sel:
if ce == []: ce.append( e )
else:
for e2 in ce:
if e.isConnectedTo( e2 ): ce.append( e ); break
for e in ce: sel.remove( e )
aCe.append( ce )
aC = []
for e in aCe: select( e, r=1 ); aC.append( polyToCurve( f=2, dg=1 ) )
grp = group( aC, n='extr_crv_grp')
setAttr( grp + '.overrideEnabled', 1 )
setAttr( grp + '.overrideColor', 17 )
select( grp, r=1 )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment