WIP: use generic copy-on-write system to avoid unnecessary data copies #104470

Closed
Jacques Lucke wants to merge 50 commits from JacquesLucke/blender:temp-copy-on-write-customdata into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 4 additions and 4 deletions
Showing only changes of commit a59b848992 - Show all commits

View File

@ -1234,8 +1234,8 @@ void BKE_mesh_legacy_face_set_from_generic(Mesh *mesh,
}
}
if (faceset_data != nullptr) {
CustomData_add_layer(
&mesh->pdata, CD_SCULPT_FACE_SETS, CD_ASSIGN, faceset_data, mesh->totpoly);
CustomData_add_layer_with_existing_data(
&mesh->pdata, CD_SCULPT_FACE_SETS, mesh->totpoly, faceset_data, nullptr);
}
}
@ -1255,8 +1255,8 @@ void BKE_mesh_legacy_face_set_to_generic(Mesh *mesh)
}
}
if (faceset_data != nullptr) {
CustomData_add_layer_named(
&mesh->pdata, CD_PROP_INT32, CD_ASSIGN, faceset_data, mesh->totpoly, ".sculpt_face_set");
CustomData_add_layer_named_with_existing_data(
&mesh->pdata, CD_PROP_INT32, ".sculpt_face_set", mesh->totpoly, faceset_data, nullptr);
}
}