diff options
author | Jacques Lucke <jacques@blender.org> | 2021-11-04 16:41:22 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-11-04 16:41:56 +0300 |
commit | ff4959eeaa5368d79f15d482da6576a1ccba5dca (patch) | |
tree | fb3372d4ed5abe0f25ae78192a8e992d30af3c2c | |
parent | b5162638c58397f32e766882fa101ab683f455a5 (diff) |
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
-rw-r--r-- | source/blender/blenkernel/intern/customdata.c | 5 |
1 files changed, 0 insertions, 5 deletions
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; } |