Page MenuHome

Fix T103394: default/active color status lost after remeshing
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Dec 22 2022, 3:14 PM.

Details

Summary

Caused by rB6514bb05ea5a.

For the remeshing, we have to make sure these names are brought over
each time a mesh is made from another in the process.

This happens when reprojecting the colors in
BKE_remesh_reproject_vertex_paint and also again in
BKE_mesh_nomain_to_mesh. A bit unsure if this should happen as deep as
in BKE_mesh_nomain_to_mesh (if not, this can be isolated to
voxel_remesh_exec), but I would assume other callers of
BKE_mesh_nomain_to_mesh would actually benefit from it, too?

Diff Detail

Repository
rB Blender

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Dec 22 2022, 3:14 PM
Philipp Oeser (lichtwerk) created this revision.

Thanks for the fix. The code is fine to me, though I think the code below is a little more direct and doesn't involve looking through the custom data layers when it shouldn't be necessary:

if (mesh_src.active_color_attribute) {
  MEM_SAFE_FREE(mesh_dst.active_color_attribute);
  mesh_dst.active_color_attribute = BLI_strdup(mesh_src.active_color_attribute);
}
if (mesh_src.default_color_attribute) {
  MEM_SAFE_FREE(mesh_dst.default_color_attribute);
  mesh_dst.default_color_attribute = BLI_strdup(mesh_src.default_color_attribute);
}
This revision is now accepted and ready to land.Dec 22 2022, 3:56 PM