[Bf-blender-cvs] [ff4959eeaa5] blender-v3.0-release: Fix T92649: incorrect copying of anonymous attributes in many places

Jacques Lucke noreply at git.blender.org
Thu Nov 4 14:42:14 CET 2021


Commit: ff4959eeaa5368d79f15d482da6576a1ccba5dca
Author: Jacques Lucke
Date:   Thu Nov 4 14:41:22 2021 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rBff4959eeaa5368d79f15d482da6576a1ccba5dca

Fix T92649: incorrect copying of anonymous attributes in many places

Many modifiers and other places use `CustomData_copy_data` to copy data
between different meshes. This function assumes that assumes that the
source and destination `CustomData` objects are "compatible" in some way.
Usually modifiers use `CustomData_copy` to create a compatible new
`CustomData` on the new mesh. The issue was that the optimization I added
for anonymous attributes broke this compatibility. It avoided copying some
attributes when they are no longer used.

This lead to attributes being copied incorrectly.
D13083 contains ideas for how this could be fixed more generally.
For now I just removed the optimization.

Differential Revision: https://developer.blender.org/D13083

===================================================================

M	source/blender/blenkernel/intern/customdata.c

===================================================================

diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index d86b8163ebc..743d5471aa7 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -2131,11 +2131,6 @@ bool CustomData_merge(const struct CustomData *source,
     if (flag & CD_FLAG_NOCOPY) {
       continue;
     }
-    if (layer->anonymous_id &&
-        !BKE_anonymous_attribute_id_has_strong_references(layer->anonymous_id)) {
-      /* This attribute is not referenced anymore, so it can be treated as if it didn't exist. */
-      continue;
-    }
     if (!(mask & CD_TYPE_AS_MASK(type))) {
       continue;
     }



More information about the Bf-blender-cvs mailing list