From b8bbb045279ddfc160c73924dc30cf43ba35509b Mon Sep 17 00:00:00 2001 From: "xun.zhang" Date: Wed, 30 Jul 2025 21:19:08 +0800 Subject: [PATCH] FIX: wrong flush volume when select filament or sync filament 1.Correct the wrong logic for support filament check jira:STUDIO-13719 Signed-off-by: xun.zhang Change-Id: Ia0d5dfa210a4335ea2a6a5f5a97ba69fd136c720 (cherry picked from commit 75c75f83679937b1fcd2ef120ac83cc9a67f125b) --- src/slic3r/GUI/GUI_App.cpp | 4 ++-- src/slic3r/GUI/GUI_App.hpp | 2 +- src/slic3r/GUI/Tab.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 31f88d16c8..d2b5a4be0f 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -7303,7 +7303,7 @@ bool has_filaments(const std::vector& model_filaments) { return false; } -bool is_support_filament(int extruder_id) +bool is_support_filament(int extruder_id, bool strict_check) { auto &filament_presets = Slic3r::GUI::wxGetApp().preset_bundle->filament_presets; auto &filaments = Slic3r::GUI::wxGetApp().preset_bundle->filaments; @@ -7317,7 +7317,7 @@ bool is_support_filament(int extruder_id) Slic3r::ConfigOptionBools *support_option = dynamic_cast(filament->config.option("filament_is_support")); - if (filament_type == "PETG" || filament_type == "PLA") { + if(!strict_check &&(filament_type == "PETG" || filament_type == "PLA")) { std::vector model_filaments; if (filament_type == "PETG") model_filaments.emplace_back("PLA"); diff --git a/src/slic3r/GUI/GUI_App.hpp b/src/slic3r/GUI/GUI_App.hpp index a4727a09be..c725a15921 100644 --- a/src/slic3r/GUI/GUI_App.hpp +++ b/src/slic3r/GUI/GUI_App.hpp @@ -721,7 +721,7 @@ private: DECLARE_APP(GUI_App) wxDECLARE_EVENT(EVT_CONNECT_LAN_MODE_PRINT, wxCommandEvent); -bool is_support_filament(int extruder_id); +bool is_support_filament(int extruder_id, bool strict_check = true); bool is_soluble_filament(int extruder_id); // check if the filament for model is in the list bool has_filaments(const std::vector& model_filaments); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index dc182b70ac..0dc6fc989e 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1688,7 +1688,7 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) if (opt_key == "support_filament") { int filament_id = m_config->opt_int("support_filament") - 1; // the displayed id is based from 1, while internal id is based from 0 int interface_filament_id = m_config->opt_int("support_interface_filament") - 1; - if (is_support_filament(filament_id) && !is_soluble_filament(filament_id) && !has_filaments({"TPU", "TPU-AMS"})) { + if (is_support_filament(filament_id, false) && !is_soluble_filament(filament_id) && !has_filaments({"TPU", "TPU-AMS"})) { wxString msg_text = _L("Non-soluble support materials are not recommended for support base. \n" "Are you sure to use them for support base? \n"); MessageDialog dialog(wxGetApp().plater(), msg_text, "", wxICON_WARNING | wxYES | wxNO); @@ -1706,7 +1706,7 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) if (opt_key == "support_interface_filament") { int filament_id = m_config->opt_int("support_filament") - 1; int interface_filament_id = m_config->opt_int("support_interface_filament") - 1; // the displayed id is based from 1, while internal id is based from 0 - if ((is_support_filament(interface_filament_id) && + if ((is_support_filament(interface_filament_id, false) && !(m_config->opt_float("support_top_z_distance") == 0 && m_config->opt_float("support_interface_spacing") == 0 && m_config->opt_enum("support_interface_pattern") == SupportMaterialInterfacePattern::smipRectilinearInterlaced)) || (is_soluble_filament(interface_filament_id) && !is_soluble_filament(filament_id))) {