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$
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$
  • $\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$ – Drudge Mar 22 '15 at 22:11
  • $\begingroup$ @Drudge can you try the update please $\endgroup$ – Chebhou Mar 22 '15 at 22:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.