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
This commit is contained in:
Jacques Lucke 2021-11-04 14:41:22 +01:00
parent b5162638c5
commit ff4959eeaa
Notes: blender-bot 2023-02-14 06:55:40 +01:00
Referenced by issue #92649, Spreadsheet evaluation state and solidify modifier change viewport results
1 changed files with 0 additions and 5 deletions

View File

@ -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;
}