bpy.ops.object.vertex_group_clean(limit=0.0, all_groups=False, keep_single=False)
If parameter 'all_groups' is False I suppose that vertex group which is active is cleared from those vertices for which weight is equal to 0.
The problem is how to set group to active one. There is function:
Set the active vertex group
Parameters: group (enum in , (optional)) – Group, Vertex group to set as active
but Blender design is very terrible because the argument is ENUM, not group id/name. For example I have group named "Head" which has id let's say 6. I got it from
Code: Select all
index =  name =  for Group in Object.vertex_groups: name.append(Group.name) index.append(Group.index)
Sorts vertex groups alphabetically
So definitelly Group.index cannot be argument of vertex_group_set_active. I don't know who prepare such not friendly API interface. How can I get to know which enum corresponds to my Group.nam(index)????
Thanks for help