From c9727b5a57d0e78c386130c1eee5bb330d3b7cee Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Wed, 8 Dec 2021 09:45:48 +0100 Subject: [PATCH 01/10] Fix of Random placment of top fill throughout model #7442 For this particular model, ClipperLib numerical instability causes one of the internal surfaces to turn into bridging surfaces on reslicing. The issue was fixed by reverting to untyped slices if possible. --- src/libslic3r/Layer.cpp | 21 ++++++++++++++++++++- src/libslic3r/Layer.hpp | 2 ++ src/libslic3r/LayerRegion.cpp | 3 +-- src/libslic3r/PrintObject.cpp | 11 +++++++++++ 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/Layer.cpp b/src/libslic3r/Layer.cpp index 5c661ed68..f99cc674d 100644 --- a/src/libslic3r/Layer.cpp +++ b/src/libslic3r/Layer.cpp @@ -92,6 +92,25 @@ void Layer::restore_untyped_slices() } } +// Similar to Layer::restore_untyped_slices() +// To improve robustness of detect_surfaces_type() when reslicing (working with typed slices), see GH issue #7442. +// Only resetting layerm->slices if Slice::extra_perimeters is always zero or it will not be used anymore +// after the perimeter generator. +void Layer::restore_untyped_slices_no_extra_perimeters() +{ + if (layer_needs_raw_backup(this)) { + for (LayerRegion *layerm : m_regions) + if (layerm->region().config().extra_perimeters.value <= 0) + layerm->slices.set(layerm->raw_slices, stInternal); + } else { + assert(m_regions.size() == 1); + LayerRegion *layerm = m_regions.front(); + // This optimization is correct, as extra_perimeters are only reused by prepare_infill() with multi-regions. + //if (layerm->region().config().extra_perimeters.value <= 0) + layerm->slices.set(this->lslices, stInternal); + } +} + ExPolygons Layer::merged(float offset_scaled) const { assert(offset_scaled >= 0.f); @@ -179,7 +198,7 @@ void Layer::make_perimeters() // group slices (surfaces) according to number of extra perimeters std::map slices; // extra_perimeters => [ surface, surface... ] for (LayerRegion *layerm : layerms) { - for (Surface &surface : layerm->slices.surfaces) + for (const Surface &surface : layerm->slices.surfaces) slices[surface.extra_perimeters].emplace_back(surface); if (layerm->region().config().fill_density > layerm_config->region().config().fill_density) layerm_config = layerm; diff --git a/src/libslic3r/Layer.hpp b/src/libslic3r/Layer.hpp index 516b6da9b..0071c7f6e 100644 --- a/src/libslic3r/Layer.hpp +++ b/src/libslic3r/Layer.hpp @@ -137,6 +137,8 @@ public: //FIXME Review whether not to simplify the code by keeping the raw_slices all the time. void backup_untyped_slices(); void restore_untyped_slices(); + // To improve robustness of detect_surfaces_type() when reslicing (working with typed slices), see GH issue #7442. + void restore_untyped_slices_no_extra_perimeters(); // Slices merged into islands, to be used by the elephant foot compensation to trim the individual surfaces with the shrunk merged slices. ExPolygons merged(float offset) const; template bool any_internal_region_slice_contains(const T &item) const { diff --git a/src/libslic3r/LayerRegion.cpp b/src/libslic3r/LayerRegion.cpp index 4dbffe7b0..fd29d6d54 100644 --- a/src/libslic3r/LayerRegion.cpp +++ b/src/libslic3r/LayerRegion.cpp @@ -51,8 +51,7 @@ void LayerRegion::slices_to_fill_surfaces_clipped() // so we're safe. This guarantees idempotence of prepare_infill() also in case // that combine_infill() turns some fill_surface into VOID surfaces. // Collect polygons per surface type. - std::vector by_surface; - by_surface.assign(size_t(stCount), SurfacesPtr()); + std::array by_surface; for (Surface &surface : this->slices.surfaces) by_surface[size_t(surface.surface_type)].emplace_back(&surface); // Trim surfaces by the fill_boundaries. diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 97d13af75..05b8c9eb6 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -227,6 +227,17 @@ void PrintObject::prepare_infill() m_print->set_status(30, L("Preparing infill")); + if (m_typed_slices) { + // To improve robustness of detect_surfaces_type() when reslicing (working with typed slices), see GH issue #7442. + // The preceding step (perimeter generator) only modifies extra_perimeters and the extra perimeters are only used by discover_vertical_shells() + // with more than a single region. If this step does not use Surface::extra_perimeters or Surface::extra_perimeters is always zero, it is safe + // to reset to the untyped slices before re-runnning detect_surfaces_type(). + for (Layer* layer : m_layers) { + layer->restore_untyped_slices_no_extra_perimeters(); + m_print->throw_if_canceled(); + } + } + // This will assign a type (top/bottom/internal) to $layerm->slices. // Then the classifcation of $layerm->slices is transfered onto // the $layerm->fill_surfaces by clipping $layerm->fill_surfaces From 3d23907056f892bd426d5722614d8f3b60a3600b Mon Sep 17 00:00:00 2001 From: YuSanka Date: Wed, 8 Dec 2021 10:40:47 +0100 Subject: [PATCH 02/10] Fix of the position of "PrusaSlicer: Open hyperlink" Dialog More info https://github.com/prusa3d/PrusaSlicer/issues/7419#issuecomment-988231014 --- src/slic3r/GUI/OptionsGroup.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/OptionsGroup.cpp b/src/slic3r/GUI/OptionsGroup.cpp index 84bfd1f9f..958a912a2 100644 --- a/src/slic3r/GUI/OptionsGroup.cpp +++ b/src/slic3r/GUI/OptionsGroup.cpp @@ -2,6 +2,7 @@ #include "ConfigExceptions.hpp" #include "Plater.hpp" #include "GUI_App.hpp" +#include "Mainframe.hpp" #include "OG_CustomCtrl.hpp" #include "MsgDialog.hpp" #include "format.hpp" @@ -978,7 +979,8 @@ bool OptionsGroup::launch_browser(const std::string& path_end) bool launch = true; if (get_app_config()->get("suppress_hyperlinks").empty()) { - RichMessageDialog dialog(nullptr, _L("Open hyperlink in default browser?"), _L("PrusaSlicer: Open hyperlink"), wxYES_NO); + wxWindow* parent = wxGetApp().mainframe->m_tabpanel; + RichMessageDialog dialog(parent, _L("Open hyperlink in default browser?"), _L("PrusaSlicer: Open hyperlink"), wxYES_NO); dialog.ShowCheckBox(_L("Remember my choice")); int answer = dialog.ShowModal(); @@ -989,7 +991,7 @@ bool OptionsGroup::launch_browser(const std::string& path_end) _L("You will not be asked about it again on label hovering.") + "\n\n" + format_wxstr(_L("Visit \"Preferences\" and check \"%1%\"\nto changes your choice."), preferences_item); - MessageDialog msg_dlg(nullptr, msg, _L("PrusaSlicer: Don't ask me again"), wxOK | wxCANCEL | wxICON_INFORMATION); + MessageDialog msg_dlg(parent, msg, _L("PrusaSlicer: Don't ask me again"), wxOK | wxCANCEL | wxICON_INFORMATION); if (msg_dlg.ShowModal() == wxID_CANCEL) return false; From fe0d7691c15ec414d1e453582b2b5275a6f6d1ca Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Wed, 8 Dec 2021 11:19:25 +0100 Subject: [PATCH 03/10] Fixed incorrect case in include --- src/slic3r/GUI/OptionsGroup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slic3r/GUI/OptionsGroup.cpp b/src/slic3r/GUI/OptionsGroup.cpp index 958a912a2..9a066b858 100644 --- a/src/slic3r/GUI/OptionsGroup.cpp +++ b/src/slic3r/GUI/OptionsGroup.cpp @@ -2,7 +2,7 @@ #include "ConfigExceptions.hpp" #include "Plater.hpp" #include "GUI_App.hpp" -#include "Mainframe.hpp" +#include "MainFrame.hpp" #include "OG_CustomCtrl.hpp" #include "MsgDialog.hpp" #include "format.hpp" From 981e2499273f955044fa4a177f018c0e3ba62e68 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Wed, 8 Dec 2021 11:22:43 +0100 Subject: [PATCH 04/10] Follow-up to c9727b5a57d0e78c386130c1eee5bb330d3b7cee Fixed incorrect use of a boolean config value --- src/libslic3r/Layer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/Layer.cpp b/src/libslic3r/Layer.cpp index f99cc674d..d273fde96 100644 --- a/src/libslic3r/Layer.cpp +++ b/src/libslic3r/Layer.cpp @@ -100,13 +100,13 @@ void Layer::restore_untyped_slices_no_extra_perimeters() { if (layer_needs_raw_backup(this)) { for (LayerRegion *layerm : m_regions) - if (layerm->region().config().extra_perimeters.value <= 0) + if (! layerm->region().config().extra_perimeters.value) layerm->slices.set(layerm->raw_slices, stInternal); } else { assert(m_regions.size() == 1); LayerRegion *layerm = m_regions.front(); // This optimization is correct, as extra_perimeters are only reused by prepare_infill() with multi-regions. - //if (layerm->region().config().extra_perimeters.value <= 0) + //if (! layerm->region().config().extra_perimeters.value) layerm->slices.set(this->lslices, stInternal); } } From 66d11bd198c51db3682d3d613d8e3dc5845ec07f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hejl?= Date: Wed, 8 Dec 2021 11:22:50 +0100 Subject: [PATCH 05/10] Changed OpenGL buffer type to GL_ELEMENT_ARRAY_BUFFER for vertex array indices in GLPaintContour. The previous type GL_ARRAY_BUFFER was used by mistake. --- src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp index e164caee6..8b866c7c9 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp @@ -859,9 +859,9 @@ void GLPaintContour::finalize_geometry() if (!this->contour_indices.empty()) { glsafe(::glGenBuffers(1, &this->m_contour_EBO_id)); - glsafe(::glBindBuffer(GL_ARRAY_BUFFER, this->m_contour_EBO_id)); - glsafe(::glBufferData(GL_ARRAY_BUFFER, this->contour_indices.size() * sizeof(unsigned int), this->contour_indices.data(), GL_STATIC_DRAW)); - glsafe(::glBindBuffer(GL_ARRAY_BUFFER, 0)); + glsafe(::glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, this->m_contour_EBO_id)); + glsafe(::glBufferData(GL_ELEMENT_ARRAY_BUFFER, this->contour_indices.size() * sizeof(unsigned int), this->contour_indices.data(), GL_STATIC_DRAW)); + glsafe(::glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0)); this->contour_indices.clear(); } } From 5b56adba59e3342bdfda1e195cde4dfda5d9ac5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hejl?= Date: Wed, 8 Dec 2021 13:19:27 +0100 Subject: [PATCH 06/10] Added a missing include (GCC11.1 without PCH). --- src/slic3r/GUI/OptionsGroup.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/slic3r/GUI/OptionsGroup.cpp b/src/slic3r/GUI/OptionsGroup.cpp index 9a066b858..6039dcbcb 100644 --- a/src/slic3r/GUI/OptionsGroup.cpp +++ b/src/slic3r/GUI/OptionsGroup.cpp @@ -8,6 +8,7 @@ #include "format.hpp" #include +#include #include #include #include From e9b9c48caebcd3f3a93554cf5eeb25a600cf1b06 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 8 Dec 2021 16:13:38 +0100 Subject: [PATCH 07/10] Fixed rear seam option, which was not always respected, the problem was originally introduced in b8c898b, recent seam changes probably made it more visible --- src/libslic3r/GCode/SeamPlacer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libslic3r/GCode/SeamPlacer.cpp b/src/libslic3r/GCode/SeamPlacer.cpp index 6d082a431..f74775a9a 100644 --- a/src/libslic3r/GCode/SeamPlacer.cpp +++ b/src/libslic3r/GCode/SeamPlacer.cpp @@ -498,7 +498,7 @@ Point SeamPlacer::calculate_seam(const Layer& layer, const SeamPosition seam_pos else if (seam_position == spRear) { // Object is centered around (0,0) in its current coordinate system. last_pos.x() = 0; - last_pos.y() += coord_t(3. * po->bounding_box().radius()); + last_pos.y() = coord_t(3. * po->bounding_box().radius()); last_pos_weight = 5.f; } if (seam_position == spNearest) { // last_pos already contains current nozzle position From 06fd732b5720070795195d4a880ba0ba0c8804fe Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 8 Dec 2021 13:07:56 +0100 Subject: [PATCH 08/10] Fixed behaviour of float sliders in SLA gizmos, which was broken after the 'Edit' button was added. This is a bit hacky fix, it might be worth improving later. --- src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp | 36 ++++++++++---------- src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp | 18 +++++----- src/slic3r/GUI/ImGuiWrapper.cpp | 6 ++++ src/slic3r/GUI/ImGuiWrapper.hpp | 10 ++++++ 4 files changed, 43 insertions(+), 27 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp index 614e83811..691a86706 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp @@ -550,24 +550,24 @@ RENDER_AGAIN: ImGui::SameLine(settings_sliders_left, m_imgui->get_item_spacing().x); ImGui::PushItemWidth(window_width - settings_sliders_left); m_imgui->slider_float("##offset", &offset, offset_min, offset_max, "%.1f mm"); - if (ImGui::IsItemHovered()) + if (m_imgui->get_last_slider_status().hovered) m_imgui->tooltip((_utf8(opts[0].second->tooltip)).c_str(), max_tooltip_width); - bool slider_clicked = ImGui::IsItemClicked(); // someone clicked the slider - bool slider_edited = ImGui::IsItemEdited(); // someone is dragging the slider - bool slider_released = ImGui::IsItemDeactivatedAfterEdit(); // someone has just released the slider + bool slider_clicked = m_imgui->get_last_slider_status().clicked; // someone clicked the slider + bool slider_edited =m_imgui->get_last_slider_status().edited; // someone is dragging the slider + bool slider_released =m_imgui->get_last_slider_status().deactivated_after_edit; // someone has just released the slider if (current_mode >= quality_mode) { ImGui::AlignTextToFramePadding(); m_imgui->text(m_desc.at("quality")); ImGui::SameLine(settings_sliders_left, m_imgui->get_item_spacing().x); m_imgui->slider_float("##quality", &quality, quality_min, quality_max, "%.1f"); - if (ImGui::IsItemHovered()) + if (m_imgui->get_last_slider_status().hovered) m_imgui->tooltip((_utf8(opts[1].second->tooltip)).c_str(), max_tooltip_width); - slider_clicked |= ImGui::IsItemClicked(); - slider_edited |= ImGui::IsItemEdited(); - slider_released |= ImGui::IsItemDeactivatedAfterEdit(); + slider_clicked |= m_imgui->get_last_slider_status().clicked; + slider_edited |= m_imgui->get_last_slider_status().edited; + slider_released |= m_imgui->get_last_slider_status().deactivated_after_edit; } if (current_mode >= closing_d_mode) { @@ -575,12 +575,12 @@ RENDER_AGAIN: m_imgui->text(m_desc.at("closing_distance")); ImGui::SameLine(settings_sliders_left, m_imgui->get_item_spacing().x); m_imgui->slider_float("##closing_distance", &closing_d, closing_d_min, closing_d_max, "%.1f mm"); - if (ImGui::IsItemHovered()) + if (m_imgui->get_last_slider_status().hovered) m_imgui->tooltip((_utf8(opts[2].second->tooltip)).c_str(), max_tooltip_width); - slider_clicked |= ImGui::IsItemClicked(); - slider_edited |= ImGui::IsItemEdited(); - slider_released |= ImGui::IsItemDeactivatedAfterEdit(); + slider_clicked |= m_imgui->get_last_slider_status().clicked; + slider_edited |= m_imgui->get_last_slider_status().edited; + slider_released |= m_imgui->get_last_slider_status().deactivated_after_edit; } if (slider_clicked) { @@ -627,9 +627,9 @@ RENDER_AGAIN: //complete non-sense. diam = std::clamp(diam, 0.1f, diameter_upper_cap); m_new_hole_radius = diam / 2.f; - bool clicked = ImGui::IsItemClicked(); - bool edited = ImGui::IsItemEdited(); - bool deactivated = ImGui::IsItemDeactivatedAfterEdit(); + bool clicked = m_imgui->get_last_slider_status().clicked; + bool edited = m_imgui->get_last_slider_status().edited; + bool deactivated = m_imgui->get_last_slider_status().deactivated_after_edit; ImGui::AlignTextToFramePadding(); m_imgui->text(m_desc["hole_depth"]); @@ -638,9 +638,9 @@ RENDER_AGAIN: // Same as above: m_new_hole_height = std::clamp(m_new_hole_height, 0.f, 100.f); - clicked |= ImGui::IsItemClicked(); - edited |= ImGui::IsItemEdited(); - deactivated |= ImGui::IsItemDeactivatedAfterEdit(); + clicked |= m_imgui->get_last_slider_status().clicked; + edited |= m_imgui->get_last_slider_status().edited; + deactivated |= m_imgui->get_last_slider_status().deactivated_after_edit;; // Following is a nasty way to: // - save the initial value of the slider before one starts messing with it diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp index 9170db603..29e1fd2f3 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp @@ -687,16 +687,16 @@ RENDER_AGAIN: // - take correct undo/redo snapshot after the user is done with moving the slider float initial_value = m_new_point_head_diameter; m_imgui->slider_float("##head_diameter", &m_new_point_head_diameter, 0.1f, diameter_upper_cap, "%.1f"); - if (ImGui::IsItemClicked()) { + if (m_imgui->get_last_slider_status().clicked) { if (m_old_point_head_diameter == 0.f) m_old_point_head_diameter = initial_value; } - if (ImGui::IsItemEdited()) { + if (m_imgui->get_last_slider_status().edited) { for (auto& cache_entry : m_editing_cache) if (cache_entry.selected) cache_entry.support_point.head_front_radius = m_new_point_head_diameter / 2.f; } - if (ImGui::IsItemDeactivatedAfterEdit()) { + if (m_imgui->get_last_slider_status().deactivated_after_edit) { // momentarily restore the old value to take snapshot for (auto& cache_entry : m_editing_cache) if (cache_entry.selected) @@ -747,18 +747,18 @@ RENDER_AGAIN: float minimal_point_distance = static_cast(opts[1])->value; m_imgui->slider_float("##minimal_point_distance", &minimal_point_distance, 0.f, 20.f, "%.f mm"); - bool slider_clicked = ImGui::IsItemClicked(); // someone clicked the slider - bool slider_edited = ImGui::IsItemEdited(); // someone is dragging the slider - bool slider_released = ImGui::IsItemDeactivatedAfterEdit(); // someone has just released the slider + bool slider_clicked = m_imgui->get_last_slider_status().clicked; // someone clicked the slider + bool slider_edited = m_imgui->get_last_slider_status().edited; // someone is dragging the slider + bool slider_released = m_imgui->get_last_slider_status().deactivated_after_edit; // someone has just released the slider ImGui::AlignTextToFramePadding(); m_imgui->text(m_desc.at("points_density")); ImGui::SameLine(settings_sliders_left); m_imgui->slider_float("##points_density", &density, 0.f, 200.f, "%.f %%"); - slider_clicked |= ImGui::IsItemClicked(); - slider_edited |= ImGui::IsItemEdited(); - slider_released |= ImGui::IsItemDeactivatedAfterEdit(); + slider_clicked |= m_imgui->get_last_slider_status().clicked; + slider_edited |= m_imgui->get_last_slider_status().edited; + slider_released |= m_imgui->get_last_slider_status().deactivated_after_edit; if (slider_clicked) { // stash the values of the settings so we know what to revert to after undo m_minimal_point_distance_stash = minimal_point_distance; diff --git a/src/slic3r/GUI/ImGuiWrapper.cpp b/src/slic3r/GUI/ImGuiWrapper.cpp index 325067aea..a01e2ed69 100644 --- a/src/slic3r/GUI/ImGuiWrapper.cpp +++ b/src/slic3r/GUI/ImGuiWrapper.cpp @@ -503,6 +503,12 @@ bool ImGuiWrapper::slider_float(const char* label, float* v, float v_min, float str_label = str_label.substr(0, pos) + str_label.substr(pos + 2); bool ret = ImGui::SliderFloat(str_label.c_str(), v, v_min, v_max, format, power); + + m_last_slider_status.hovered = ImGui::IsItemHovered(); + m_last_slider_status.edited = ImGui::IsItemEdited(); + m_last_slider_status.clicked = ImGui::IsItemClicked(); + m_last_slider_status.deactivated_after_edit = ImGui::IsItemDeactivatedAfterEdit(); + if (!tooltip.empty() && ImGui::IsItemHovered()) this->tooltip(into_u8(tooltip).c_str(), max_tooltip_width); diff --git a/src/slic3r/GUI/ImGuiWrapper.hpp b/src/slic3r/GUI/ImGuiWrapper.hpp index 590ef95b0..255c4171b 100644 --- a/src/slic3r/GUI/ImGuiWrapper.hpp +++ b/src/slic3r/GUI/ImGuiWrapper.hpp @@ -39,6 +39,13 @@ class ImGuiWrapper std::string m_clipboard_text; public: + struct LastSliderStatus { + bool hovered { false }; + bool edited { false }; + bool clicked { false }; + bool deactivated_after_edit { false }; + }; + ImGuiWrapper(); ~ImGuiWrapper(); @@ -63,6 +70,7 @@ public: ImVec2 get_item_spacing() const; float get_slider_float_height() const; + const LastSliderStatus& get_last_slider_status() const { return m_last_slider_status; } void set_next_window_pos(float x, float y, int flag, float pivot_x = 0.0f, float pivot_y = 0.0f); void set_next_window_bg_alpha(float alpha); @@ -146,6 +154,8 @@ private: static const char* clipboard_get(void* user_data); static void clipboard_set(void* user_data, const char* text); + + LastSliderStatus m_last_slider_status; }; From 77e8429eae3f7046aab68496e62bd4b260a74559 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Wed, 8 Dec 2021 16:36:35 +0100 Subject: [PATCH 09/10] Fix for #7146 - Reset settings for spiral vase mode is inconsistent --- src/slic3r/GUI/Tab.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 3172e22c3..335dd6619 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -885,6 +885,10 @@ void Tab::on_roll_back_value(const bool to_sys /*= true*/) } m_postpone_update_ui = false; + + // When all values are rolled, then we hane to update whole tab in respect to the reverted values + update(); + update_changed_ui(); } @@ -1148,6 +1152,13 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) if (opt_key == "extruders_count") wxGetApp().plater()->on_extruders_change(boost::any_cast(value)); + if (m_postpone_update_ui) { + // It means that not all values are rolled to the system/last saved values jet. + // And call of the update() can causes a redundant check of the config values, + // see https://github.com/prusa3d/PrusaSlicer/issues/7146 + return; + } + update(); } From f697ede19ac93b9dee50c76aa01c9d17a69def19 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Wed, 8 Dec 2021 16:56:05 +0100 Subject: [PATCH 10/10] The default SLA material speed was set to fast. --- src/libslic3r/PrintConfig.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 11e741ec6..b2e645714 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -3773,7 +3773,7 @@ void PrintConfigDef::init_sla_params() def->enum_labels.push_back(L("Slow")); def->enum_labels.push_back(L("Fast")); def->mode = comAdvanced; - def->set_default_value(new ConfigOptionEnum(slamsSlow)); + def->set_default_value(new ConfigOptionEnum(slamsFast)); } void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &value)