0
$\begingroup$

I'm making an addon and I need to store some extra information on vertices. The natural way to do this seems to be generating a group and set weights of vertices in it. But I read this from the official doc:

In order to be used for things like deformation, weights usually have to be normalized, so that all deforming weights assigned to a single vertex add up to 1. The Armature modifier in Blender does this automatically, so it is technically not necessary to ensure that weights are normalized at the painting stage.

Does it mean that if I set a vertex's weight in my script-generated group, say 100000, it would cause all the other weights for bones to be normalized to very small numbers, so that they add to 1?

Is vertex weight generally the correct way to store extra information for scripting?

$\endgroup$

1 Answer 1

5
$\begingroup$

You don't have to worry about normalization. You do have to worry about clamping.

First, clamping. Blender will not let you use a vertex weight of less than 0.0 or greater than 1.0. (Well, I've seen some bugged files with negative values, but it's not supposed to happen.) Vertex group assignments are not intended to be used outside of this range, so 100000 is right out.

There are alternatives. First, even though you can't have 100k weights, you can just divide all your weights by 100k and then make your effect 100k times as strong. Second, while you haven't said what your end goal is, you can store information in other ways, including UV (which is also clamped, but to a much greater range.)

Okay, normalization. Normalization doesn't affect your actual groups, and it only happens at the time of evaluating an armature. Let's say you have two bones, and all your verts are weighted fully to both of these bones. In order to evaluate your armature, Blender normalizes the weights-- so our weight is the weight, divided by the sum (of all weights for groups with the same names as deforming bones in the armature.) The actual weight values are unchanged, it's all totally behind the scenes, and it only affects armature deformation.

$\endgroup$

You must log in to answer this question.

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