Remove from uv list


#1

Hi I’m quite noob with maya script.
Can someone explain me this?
This is what I expect

a = [0,1,2,3]
print a
[0, 1, 2, 3]
a.remove(1)
print a
[0, 2, 3]

And this is my problem:

uvShellVerts = cmds.ls(sl=True, fl=True)
print uvShellVerts
for mapOne in uvShellVerts:
     comparableList = list(uvShellVerts)
     comparableList = comparableList.remove(mapOne)
     print mapOne
     print comparableList
     break
 [u'pPlane1.map[0]', u'pPlane1.map[1]', u'pPlane1.map[2]', u'pPlane1.map[3]', u'pPlane1.map[4]', u'pPlane1.map[5]', u'pPlane1.map[6]', u'pPlane1.map[7]', u'pPlane1.map[8]', u'pPlane1.map[9]']
pPlane1.map[0]
 None

why None?
I expect the first list without the pPlane1.map[0]

Thanks


#2
comparableList = comparableList.remove(mapOne) 

this was the error.

To many c like code in my life
this one is correct

 comparableList.remove(mapOne)

#3

Yes, that’s it: Any python funciton with no explicit return will return None. It’s basically void