delete specific elements from list -


first select group named hairsystem1follicles , make list of make empty list things delete

cmds.select('hairsystem1follicles',hi=1) list=cmds.ls(sl=1) listtodelete=[] 

i have tried 2 things, both useless. isolate elements in list name curve1 curve2 etc. not # other things in list named loftfolicle* attempt 1

for e in list:     if e=='curve*': #find ones write nodes         listtodelete.append(e) 

attempt 2

for e in list:     if 'curve'+'*' in e:         listtodelete.append(e) 

neither seem work out.

i dont know how functions use list (i rename list, because "list" typename of built-in list), if list contains strings, code should work:

for e in mylist: //renamed list     if e.lower().startswith("curve"):         listtodelete.append(e) 

this code checks, if lowercase version of e starts "curve", things "curve2", "curve4", "curveandsoon" appended listtodelete. if there more conditions check on e, let me know. way, if e no string, maybe because iterate list of object, , "the name of e" (the actual string check) e.g. e.name(), add line of code @ beginning of loop:

e = e.name() //or else, if e no string, e.name() 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -