Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-06-25 00:39:58 +0300
committerHans Goudey <h.goudey@me.com>2022-06-25 00:39:58 +0300
commit12bde317f4c94d48a154c8815ad910ccdd73be74 (patch)
tree399ed5ac58eacc604b768c767e56ab2e1046f872 /source/blender/blenkernel
parent35d2a2284659ca0e308d37765b803a66157de2f7 (diff)
Fix T98949: Deleting vertex group in geometry nodes affects others
The vertex group indices stored in the weights need to be accounted for when the vertex group list on the mesh changes.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/geometry_component_mesh.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/geometry_component_mesh.cc b/source/blender/blenkernel/intern/geometry_component_mesh.cc
index 88ea1af8a8d..9e64acf218b 100644
--- a/source/blender/blenkernel/intern/geometry_component_mesh.cc
+++ b/source/blender/blenkernel/intern/geometry_component_mesh.cc
@@ -1092,6 +1092,11 @@ class VertexGroupsAttributeProvider final : public DynamicAttributesProvider {
for (MDeformVert &dvert : MutableSpan(mesh->dvert, mesh->totvert)) {
MDeformWeight *weight = BKE_defvert_find_index(&dvert, index);
BKE_defvert_remove_group(&dvert, weight);
+ for (MDeformWeight &weight : MutableSpan(dvert.dw, dvert.totweight)) {
+ if (weight.def_nr > index) {
+ weight.def_nr--;
+ }
+ }
}
return true;
}