Hi, all! Please look at the following script:
import bpy
count = 0
def evaluate(mesh):
____#mesh = bpy.types.Mesh
____#v = bpy.types.MeshVertex
____global count
____for v in mesh.vertices:
________if v.select:
____________count += 1
____print(count)
evaluate(bpy.context.active_object.data)
As you can see, I want to get the count of a mesh’s selected vertices. When I run this script from the Blender default file, I always get the same answer : 8 ( which makes some kind of sense, as the only available mesh is a cube ).
The context (object or edit) doesn’t matter. The cube can be selected or not: it doesn’t matter. All vertices can be selected in edit mode, some of them or none of them: it doesn’t matter.
I can’t make any sense out of this.
Thanks in advance,
Thierry
P.S : I also can’t fix the indents in this post and that’s why I use underscores here. But please take my word: they are correct :o