mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 10:32:20 +00:00
Remap paint after smooth
This commit is contained in:
@@ -6210,6 +6210,7 @@ void GUI::ObjectList::smooth_mesh()
|
||||
WarningDialog dlg(static_cast<wxWindow *>(wxGetApp().mainframe), content, wxEmptyString, wxOK);
|
||||
dlg.ShowModal();
|
||||
};
|
||||
const bool keep_painting = GUI::wxGetApp().app_config->get_bool("keep_painting");
|
||||
bool has_show_smooth_mesh_error_dlg = false;
|
||||
if (vol_idxs.empty()) {
|
||||
obj = object(object_idx);
|
||||
@@ -6221,8 +6222,11 @@ void GUI::ObjectList::smooth_mesh()
|
||||
bool ok;
|
||||
auto result_mesh = TriangleMeshDeal::smooth_triangle_mesh(mv->mesh(), ok);
|
||||
if (ok) {
|
||||
const std::optional<TriangleSelector::SavedPainting> saved_painting = keep_painting ?
|
||||
mv->save_painting() :
|
||||
std::optional<TriangleSelector::SavedPainting>{};
|
||||
mv->set_mesh(result_mesh);
|
||||
mv->reset_extra_facets(); // reset paint color
|
||||
mv->restore_painting(saved_painting);
|
||||
mv->calculate_convex_hull();
|
||||
mv->invalidate_convex_hull_2d();
|
||||
mv->set_new_unique_id();
|
||||
@@ -6247,8 +6251,11 @@ void GUI::ObjectList::smooth_mesh()
|
||||
bool ok;
|
||||
auto result_mesh = TriangleMeshDeal::smooth_triangle_mesh(mv->mesh(),ok);
|
||||
if (ok) {
|
||||
const std::optional<TriangleSelector::SavedPainting> saved_painting = keep_painting ?
|
||||
mv->save_painting() :
|
||||
std::optional<TriangleSelector::SavedPainting>{};
|
||||
mv->set_mesh(result_mesh);
|
||||
mv->reset_extra_facets(); // reset paint color
|
||||
mv->restore_painting(saved_painting);
|
||||
mv->calculate_convex_hull();
|
||||
mv->invalidate_convex_hull_2d();
|
||||
mv->set_new_unique_id();
|
||||
|
||||
Reference in New Issue
Block a user