diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 273784191..8d649a355 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -1417,7 +1417,7 @@ BoundingBoxf3 GLCanvas3D::_get_current_partplate_print_volume() return test_volume; } -void GLCanvas3D::construct_error_string(ObjectFilamentResults& object_result, std::string& error_string) +static bool construct_error_string(ObjectFilamentResults& object_result, std::string& error_string) { error_string.clear(); if (!object_result.partly_outside_objects.empty()) { @@ -1428,8 +1428,9 @@ void GLCanvas3D::construct_error_string(ObjectFilamentResults& object_result, st error_string += "\n"; } error_string += _u8L("Please solve the problem by moving it totally on or off the plate, and confirming that the height is within the build volume.\n"); + return true; } - + return false; } static std::pair construct_extruder_unprintable_error(ObjectFilamentResults& object_result, std::string& left_extruder_unprintable_text, std::string& right_extruder_unprintable_text) @@ -1476,8 +1477,8 @@ static std::pair construct_extruder_unprintable_error(ObjectFilament auto& output_text = idx == 0 ? left_extruder_unprintable_text : right_extruder_unprintable_text; if (unprintable_objs.empty()) continue; - std::string nozzle_name = nozzle_name_list[0]; - std::string opposite_nozzle_name = idx == 0 ? nozzle_name_list[1] : nozzle_name_list[0]; + std::string nozzle_name = nozzle_name_list[idx]; + std::string opposite_nozzle_name = nozzle_name_list[1-idx]; std::string model_prefix; if (object_result.object_filaments.size() > 1) model_prefix = _u8L("Some models are"); @@ -3000,10 +3001,10 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re const bool fullyOut = (state == ModelInstanceEPrintVolumeState::ModelInstancePVS_Fully_Outside); const bool objectLimited = (state == ModelInstanceEPrintVolumeState::ModelInstancePVS_Limited); - construct_error_string(object_results, get_object_clashed_text()); + auto clash_flag = construct_error_string(object_results, get_object_clashed_text()); auto unprintable_flag= construct_extruder_unprintable_error(object_results, get_left_extruder_unprintable_text(), get_right_extruder_unprintable_text()); - _set_warning_notification(EWarning::ObjectClashed, partlyOut); + _set_warning_notification(EWarning::ObjectClashed, clash_flag); _set_warning_notification(EWarning::LeftExtruderPrintableError, unprintable_flag.first); _set_warning_notification(EWarning::RightExtruderPrintableError, unprintable_flag.second); _set_warning_notification(EWarning::ObjectLimited, objectLimited); @@ -10168,7 +10169,6 @@ void GLCanvas3D::_set_warning_notification(EWarning warning, bool state) case EWarning::SlaSupportsOutside: text = ("SLA supports outside the print area were detected."); error = ErrorType::PLATER_ERROR; break; case EWarning::SomethingNotShown: text = _u8L("Only the object being edited is visible."); break; case EWarning::ObjectClashed: - text = get_object_clashed_text(); error = ErrorType::PLATER_ERROR; break; case EWarning::ObjectLimited: @@ -10222,6 +10222,16 @@ void GLCanvas3D::_set_warning_notification(EWarning warning, bool state) notification_manager.close_slicing_customize_error_notification(NotificationType::RightExtruderUnprintableError, NotificationLevel::ErrorNotificationLevel); } } + else if (warning == EWarning::ObjectClashed) { + auto str = get_object_clashed_text(); + if(state){ + if (!str.empty()) + notification_manager.push_plater_error_notification(str); + } + else{ + notification_manager.close_plater_error_notification(str); + } + } else { if (state) notification_manager.push_plater_error_notification(text); diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index a8422caf4..0a0d544f8 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -759,7 +759,6 @@ public: unsigned int get_volumes_count() const; const GLVolumeCollection& get_volumes() const { return m_volumes; } void reset_volumes(); - static void construct_error_string(ObjectFilamentResults& object_result, std::string& error_string); ModelInstanceEPrintVolumeState check_volumes_outside_state(ObjectFilamentResults* object_results = nullptr) const; bool is_all_plates_selected() { return m_sel_plate_toolbar.m_all_plates_stats_item && m_sel_plate_toolbar.m_all_plates_stats_item->selected; } const float get_scale() const; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index f22b85133..3fdd96b4b 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -15643,11 +15643,13 @@ void Plater::validate_current_plate(bool& model_fits, bool& validate_error) p->view3D->get_canvas3d()->set_sequential_print_clearance_polygons(polygons, height_polygons); } + auto clashed_text = get_object_clashed_text(); if (!model_fits) { - p->notification_manager->push_plater_error_notification(get_object_clashed_text()); + if(!clashed_text.empty()) + p->notification_manager->push_plater_error_notification(clashed_text); } else { - p->notification_manager->close_plater_error_notification(get_object_clashed_text()); + p->notification_manager->close_plater_error_notification(clashed_text); } if (state == ModelInstancePVS_Limited) {