Page 1 of 1

How to get to know how much vertices is inside vertexGroup?

Posted: Sat Nov 02, 2013 11:52 pm
by anders211
I see bug in blender interface: ... ertexGroup

There is none way to get to know how much vertices are in this vertex group.

Posted: Sun Nov 03, 2013 12:37 am
by CoDEmanX
You can do that like:

Code: Select all

ob = bpy.context.object
vgroup_verts = { [] for vgroup in ob.vertex_groups}

for v in
    for g in v.groups:

for vgroup in vgroup_verts:
    vcount = len(vgroup_verts[vgroup])
    print("Vertex Group '%s' has %i %s." % (vgroup, vcount, "vertex" if vcount == 1 else "vertices"))