# Why is deselecting vertices with bmesh not working?

I want to make use of the bmesh module to update mesh selection.
To select vertices works as expected, but to unselect vertices does not work for me...

Am I missing something or is this a bug?

bm = bmesh.new()
bm.from_mesh(obj.data)

bm.verts.ensure_lookup_table()

#this works

for v in bm.verts:
v.select = True

#this does not work

for v in bm.verts:
v.select = False

bm.to_mesh(obj.data)
bm.free()

• This is probably due to the selection states of faces and edges. – lemon Mar 13 at 17:14
• thanks @lemon! using faces solved the problem! :) – f.bra Mar 13 at 17:18