Scripting in Blender with Python, and working on the API
3 posts • Page 1 of 1
Is there a way to quickly do that without being forced to iterate through the verts and checking their 'select' flag?
no there isn't, see http://wiki.blender.org/index.php/Dev:2 ... esign_TODO
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
Note: this requires blender 2.67+
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])
I'm sitting, waiting, wishing, building Blender in superstition...