How to obtain the number of selected vertices in a mesh...
Posted: Sat Jun 01, 2013 9:20 pm
Is there a way to quickly do that without being forced to iterate through the verts and checking their 'select' flag?
for a quick check without leaving editmode you could do:convenience function to get selected verts/edges/faces to prevent expensive iteration over meshes. Something like: me.verts.selected
Code: Select all
ob = bpy.context.object ob.update_from_editmode() # not available in older versions! verts_sel = len([v for v in ob.data.vertices if v.select])