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
path: root/source
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-01-16 17:24:22 +0300
committerJacques Lucke <jacques@blender.org>2021-01-16 17:24:22 +0300
commit1e193a0b564c72c006203a1e349269e4bb004d0e (patch)
tree8c366bee86e796ba8775719a39603418ab1fc0fa /source
parentf7829961c64f0fafa58efb6abfc8b7da3a500f77 (diff)
Fix T84757: feedback loop with when modifying vertex group with nodes
The issue was that the mesh shared its vertex weights with the original mesh (to reduce memory consumption). The solution is to make a local copy of the vertex weights in this case.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/attribute_access.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc
index a7939beae90..2e1094364fd 100644
--- a/source/blender/blenkernel/intern/attribute_access.cc
+++ b/source/blender/blenkernel/intern/attribute_access.cc
@@ -1191,6 +1191,11 @@ WriteAttributePtr MeshComponent::attribute_try_get_for_write(const StringRef att
if (mesh_->dvert == nullptr) {
BKE_object_defgroup_data_create(&mesh_->id);
}
+ else {
+ /* Copy the data layer if it is shared with some other mesh. */
+ mesh_->dvert = (MDeformVert *)CustomData_duplicate_referenced_layer(
+ &mesh_->vdata, CD_MDEFORMVERT, mesh_->totvert);
+ }
return std::make_unique<blender::bke::VertexWeightWriteAttribute>(
mesh_->dvert, mesh_->totvert, vertex_group_index);
}