1
$\begingroup$

I have a mesh attached to an armature with many bones. I have generated weights off the bones automatically. In some areas, the amount of weight each bone got is uneven, causing distortion between bones. In these areas, the weight of the groups does not reach 1 for those bones. I could solve these problems if I could add to all groups to bring them up to weight 1.

How can I add a set amount to the weight of every vertex in a vertex group (such as +.03), and do this automatically for every vertex group on an object? I have far too many bones to do it by hand.

$\endgroup$

1 Answer 1

2
$\begingroup$

select the object set the addition value and Run this script :

import bpy

addition = 0.1

obj = bpy.context.active_object
obj_data = obj.data
bpy.ops.object.mode_set(mode = 'OBJECT')
for vert in obj_data.vertices:
    for g in obj_data.vertices[vert.index].groups:
            g.weight  = g.weight +addition
$\endgroup$
2
  • $\begingroup$ Thanks, I gave it a try and got: Traceback (most recent call last): File "<blender_console>", line 4, in <module> RuntimeError: Error: Vertex not in group $\endgroup$
    – Ascalon
    Commented Mar 22, 2015 at 22:11
  • $\begingroup$ @Drudge can you try the update please $\endgroup$
    – Chebhou
    Commented Mar 22, 2015 at 22:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .