mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-21 04:13:50 +00:00
Remap paint after simplify
This commit is contained in:
@@ -535,12 +535,20 @@ void GLGizmoSimplify::apply_simplify() {
|
|||||||
|
|
||||||
auto plater = wxGetApp().plater();
|
auto plater = wxGetApp().plater();
|
||||||
plater->take_snapshot(GUI::format("Simplify %1%", m_volume->name));
|
plater->take_snapshot(GUI::format("Simplify %1%", m_volume->name));
|
||||||
|
const bool keep_painting = GUI::wxGetApp().app_config->get_bool("keep_painting");
|
||||||
|
if (!keep_painting) {
|
||||||
plater->clear_before_change_mesh(object_idx);
|
plater->clear_before_change_mesh(object_idx);
|
||||||
|
}
|
||||||
|
|
||||||
ModelVolume* mv = get_model_volume(selection, wxGetApp().model());
|
ModelVolume* mv = get_model_volume(selection, wxGetApp().model());
|
||||||
assert(mv == m_volume);
|
assert(mv == m_volume);
|
||||||
|
|
||||||
|
// Save paint
|
||||||
|
std::optional<TriangleSelector::SavedPainting> saved_painting = keep_painting ? mv->save_painting() :
|
||||||
|
std::optional<TriangleSelector::SavedPainting>{};
|
||||||
mv->set_mesh(std::move(*m_state.result));
|
mv->set_mesh(std::move(*m_state.result));
|
||||||
|
// Remap paint
|
||||||
|
mv->restore_painting(saved_painting);
|
||||||
m_state.result.reset();
|
m_state.result.reset();
|
||||||
mv->calculate_convex_hull();
|
mv->calculate_convex_hull();
|
||||||
mv->invalidate_convex_hull_2d();
|
mv->invalidate_convex_hull_2d();
|
||||||
|
|||||||
Reference in New Issue
Block a user