diff --git a/src/slic3r/GUI/DoubleSlider.cpp b/src/slic3r/GUI/DoubleSlider.cpp index 00b9c2e290..77cc5bec79 100644 --- a/src/slic3r/GUI/DoubleSlider.cpp +++ b/src/slic3r/GUI/DoubleSlider.cpp @@ -424,6 +424,22 @@ void Control::SetExtruderColors( const std::vector& extruder_colors m_extruder_colors = extruder_colors; } +bool Control::IsNewPrint() +{ + if (GUI::wxGetApp().plater()->printer_technology() == ptSLA) + return false; + const Print& print = GUI::wxGetApp().plater()->fff_print(); + std::string idxs; + for (auto object : print.objects()) + idxs += std::to_string(object->id().id) + "_"; + + if (idxs == m_print_obj_idxs) + return false; + + m_print_obj_idxs = idxs; + return true; +} + void Control::get_lower_and_higher_position(int& lower_pos, int& higher_pos) { const double step = get_scroll_step(); diff --git a/src/slic3r/GUI/DoubleSlider.hpp b/src/slic3r/GUI/DoubleSlider.hpp index 52f7be6294..49588f4f03 100644 --- a/src/slic3r/GUI/DoubleSlider.hpp +++ b/src/slic3r/GUI/DoubleSlider.hpp @@ -233,6 +233,8 @@ public: void SetModeAndOnlyExtruder(const bool is_one_extruder_printed_model, const int only_extruder); void SetExtruderColors(const std::vector& extruder_colors); + bool IsNewPrint(); + void set_render_as_disabled(bool value) { m_render_as_disabled = value; } bool is_rendering_as_disabled() const { return m_render_as_disabled; } @@ -395,6 +397,7 @@ private: TickCodeInfo m_ticks; std::vector m_layers_times; std::vector m_extruder_colors; + std::string m_print_obj_idxs; #if ENABLE_GCODE_LINES_ID_IN_H_SLIDER std::vector m_alternate_values; diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index 9f9f20ffb6..8bda3b8e67 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -1,3 +1,4 @@ +//#include "stdlib.h" #include "libslic3r/libslic3r.h" #include "libslic3r/Layer.hpp" #include "GUI_Preview.hpp" @@ -642,10 +643,10 @@ void Preview::update_layers_slider(const std::vector& layers_z, bool kee m_layers_slider->SetLayersTimes(m_gcode_result->time_statistics.modes.front().layers_times); // Suggest the auto color change, if model looks like sign - if (ticks_info_from_model.gcodes.empty()) + if (m_layers_slider->IsNewPrint()) { NotificationManager* notif_mngr = wxGetApp().plater()->get_notification_manager(); - notif_mngr->close_notification_of_type(NotificationType::SignDetected); +// notif_mngr->close_notification_of_type(NotificationType::SignDetected); const Print& print = wxGetApp().plater()->fff_print(); double delta_area = scale_(scale_(25)); // equal to 25 mm2 @@ -658,8 +659,8 @@ void Preview::update_layers_slider(const std::vector& layers_z, bool kee continue; const ExPolygons& bottom = object->get_layer(0)->lslices; - if (bottom.size() > 1 || !bottom[0].holes.empty()) - continue; + //if (bottom.size() > 1 || !bottom[0].holes.empty()) + // continue; double bottom_area = area(bottom); int i;