Fix #148229: Vertex weights in wrong groups after joining meshes

Caused by 113d91aba8

Code first gathers a list of all vertexgroups on all objects.
Then it iterates the objects to join, and for each of them, puts their
vertexgroups in an index map.
However (by a typo?), it was doing it for the `active mesh` (instead of
the one currently visited) over and over again, resulting in weights
from other objects written to `def_nr` from groups of the `active mesh`.

Now corrected.

Pull Request: https://projects.blender.org/blender/blender/pulls/148259
This commit is contained in:
Philipp Oeser
2025-10-17 15:06:24 +02:00
committed by Philipp Oeser
parent c990cd6759
commit 1de7b4372c

View File

@@ -84,7 +84,7 @@ static VectorSet<std::string> join_vertex_groups(const Span<const Object *> obje
continue; continue;
} }
Vector<int, 32> index_map; Vector<int, 32> index_map;
LISTBASE_FOREACH (const bDeformGroup *, dg, &dst_mesh.vertex_group_names) { LISTBASE_FOREACH (const bDeformGroup *, dg, &src_mesh.vertex_group_names) {
index_map.append(vertex_group_names.index_of_as(dg->name)); index_map.append(vertex_group_names.index_of_as(dg->name));
} }
for (const int vert : src_dverts.index_range()) { for (const int vert : src_dverts.index_range()) {