Cleanup: Manifold Boolean: Change order of mesh construction

This patch swap position attribute initialization and edge construction
of boolean result. Logic is what both of these steps are last, all
future code do not build mesh topology but only maintain user
attributes. So at this point mesh already must be valid. But future
change of edge calculation (#132492) code will requer this mesh
validation to be done as part of the step. So when edges will be
calculated mesh must already be built, valid and contains position
attribute.

Pull Request: https://projects.blender.org/blender/blender/pulls/146229
This commit is contained in:
илья _
2025-10-02 15:14:32 +02:00
committed by Hans Goudey
parent bb3f0f5401
commit d4e254a552

View File

@@ -1824,13 +1824,6 @@ static Mesh *meshgl_to_mesh(MeshGL &mgl,
});
}
{
# ifdef DEBUG_TIME
timeit::ScopedTimer timer_e("calculating edges");
# endif
bke::mesh_calc_edges(*mesh, false, false);
}
/* Set the vertex positions, using implicit sharing to avoid copying any data. */
{
# ifdef DEBUG_TIME
@@ -1845,6 +1838,15 @@ static Mesh *meshgl_to_mesh(MeshGL &mgl,
sharing_info->remove_user_and_delete_if_last();
}
{
# ifdef DEBUG_TIME
timeit::ScopedTimer timer_e("calculating edges");
# endif
bke::mesh_calc_edges(*mesh, false, false);
}
BLI_assert(BKE_mesh_is_valid(mesh));
OutToInMaps out_to_in(&ma, joined_mesh, mesh, &mesh_offsets);
{