Fix T100974: Remesh operators reset mesh properties

Caused by 21f2bacad9 which copies a few more values to
the original meshes from the "nomain" meshes. The "nomain" meshes
created from the originals need to copy some values as well.
This commit is contained in:
Hans Goudey 2022-09-10 18:06:54 -05:00
parent 8b612c6496
commit 1f4dc51d09
Notes: blender-bot 2023-02-14 07:39:46 +01:00
Referenced by issue #101004, Regression: Segfault when CTRL key hit
Referenced by issue #100986, Materials are not locked to faces during edits
Referenced by issue #100974, Voxel Remesh always resetting to its default values
1 changed files with 4 additions and 1 deletions

View File

@ -124,6 +124,7 @@ static Mesh *remesh_quadriflow(const Mesh *input_mesh,
/* Construct the new output mesh */
Mesh *mesh = BKE_mesh_new_nomain(qrd.out_totverts, 0, 0, qrd.out_totfaces * 4, qrd.out_totfaces);
BKE_mesh_copy_parameters(mesh, input_mesh);
MutableSpan<MVert> mesh_verts = mesh->verts_for_write();
MutableSpan<MPoly> polys = mesh->polys_for_write();
MutableSpan<MLoop> loops = mesh->loops_for_write();
@ -273,7 +274,9 @@ Mesh *BKE_mesh_remesh_voxel(const Mesh *mesh,
{
#ifdef WITH_OPENVDB
openvdb::FloatGrid::Ptr level_set = remesh_voxel_level_set_create(mesh, voxel_size);
return remesh_voxel_volume_to_mesh(level_set, isovalue, adaptivity, false);
Mesh *result = remesh_voxel_volume_to_mesh(level_set, isovalue, adaptivity, false);
BKE_mesh_copy_parameters(result, mesh);
return result;
#else
UNUSED_VARS(mesh, voxel_size, adaptivity, isovalue);
return nullptr;