No way to get the selected vertices list?!?!??!?

I read somewhere in this forum that you can’t get the list of the selected vertices of an object in python. Is it true?? If the user selects only one vertex, is there no way to see it in python?

Also, I’m having hard time with getting the selected faces list with the getSelectedFaces() function as well (my code is below). I guess I don’t understand the principle: Does a mesh object hold only the vertices position data, or does it hold the selected faces data as well?

Thanks!


import Blender
from Blender import NMesh
from Blender import Object

slc = Object.GetSelected()
mesh = slc[0].getData()

slcfaces = mesh.getSelectedFaces()
first = slcfaces[0] #ERROR - list index out of range

I have run it when many faces were selected, and got the error above. What am I doing wrong?

Thanks!

selverts = [v for v in me.verts if v.sel]