Commit: fb8778a28c932a78b4f680e4b6eccd3441b38752 Author: Philipp Oeser Date: Thu Dec 22 15:13:08 2022 +0100 Branches: master https://developer.blender.org/rBfb8778a28c932a78b4f680e4b6eccd3441b38752
Fix T103394: default/active color status lost after remeshing 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? Maniphest Tasks: T103394 Differential Revision: https://developer.blender.org/D16847 =================================================================== M source/blender/blenkernel/intern/mesh_convert.cc M source/blender/blenkernel/intern/mesh_remesh_voxel.cc =================================================================== diff --git a/source/blender/blenkernel/intern/mesh_convert.cc b/source/blender/blenkernel/intern/mesh_convert.cc index 8354de20e20..9f9548a5e4c 100644 --- a/source/blender/blenkernel/intern/mesh_convert.cc +++ b/source/blender/blenkernel/intern/mesh_convert.cc @@ -1191,6 +1191,16 @@ void BKE_mesh_nomain_to_mesh(Mesh *mesh_src, Mesh *mesh_dst, Object *ob) CustomData_copy(&mesh_src->pdata, &mesh_dst->pdata, mask.pmask, CD_ASSIGN, mesh_src->totpoly); CustomData_copy(&mesh_src->ldata, &mesh_dst->ldata, mask.lmask, CD_ASSIGN, mesh_src->totloop); + /* Make sure active/default color attribute (names) are brought over. */ + 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); + } + BLI_freelistN(&mesh_dst->vertex_group_names); mesh_dst->vertex_group_names = mesh_src->vertex_group_names; BLI_listbase_clear(&mesh_src->vertex_group_names); diff --git a/source/blender/blenkernel/intern/mesh_remesh_voxel.cc b/source/blender/blenkernel/intern/mesh_remesh_voxel.cc index a2916c75d51..ddc0625ba6b 100644 --- a/source/blender/blenkernel/intern/mesh_remesh_voxel.cc +++ b/source/blender/blenkernel/intern/mesh_remesh_voxel.cc @@ -489,6 +489,16 @@ void BKE_remesh_reproject_vertex_paint(Mesh *target, const Mesh *source) } } + /* Make sure active/default color attribute (names) are brought over. */ + if (source->active_color_attribute) { + MEM_SAFE_FREE(target->active_color_attribute); + target->active_color_attribute = BLI_strdup(source->active_color_attribute); + } + if (source->default_color_attribute) { + MEM_SAFE_FREE(target->default_color_attribute); + target->default_color_attribute = BLI_strdup(source->default_color_attribute); + } + MEM_SAFE_FREE(source_lmap); MEM_SAFE_FREE(source_lmap_mem); MEM_SAFE_FREE(target_lmap); _______________________________________________ Bf-blender-cvs mailing list [email protected] List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
