Fix incorrect merged weights from ignored bones in FBX import #104928

Merged
Thomas Barlow merged 3 commits from Mysteryem/blender-addons:fbx_cluster_import_no_divide into blender-v4.0-release 2023-10-06 05:25:42 +02:00

3 Commits

Author SHA1 Message Date
451c665c94 Increase FBX IO Version 2023-10-06 04:19:04 +01:00
7efdd8a0dc Merge branch 'blender-v4.0-release' into fbx_cluster_import_no_divide 2023-10-06 04:17:13 +01:00
a2e10e6a9c Fix incorrect merged weights from ignored bones in FBX import
Given a chain of bones A -> B -> C and a vertex weighted to all three
bones: When C is ignored and its weight is to be merged into its parent
B, the sum of the weights that are not A should remain the same as
before the merge. The current code is instead setting the B weight to
the average of the B and C weights, which does not maintain the sum of
the weights. The division that was creating the average has been
removed, so now the weights in C to be merged into B are added directly
to the B weight.

Because the maximum value a weight can be set to is 1.0, this poses a
problem when the weights to be added together exceed 1.0. Re-normalizing
all the weights on the vertex in this case sounds like it could work,
but unfortunately, we only have access to all the weights for one bone
at a time with the current implementation. Re-normalizing the weights
after adding all the weights to each vertex is too late because the
weights exceeding 1.0 would already have been clamped to 1.0. A comment
has been added to indicate that this is a known issue.
2023-10-01 00:50:45 +01:00