diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 1cf2ca17c..94b070e47 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -743,6 +743,13 @@ wxNotebook* GUI_App::tab_panel() const return mainframe->m_tabpanel; } +int GUI_App::extruders_cnt() const +{ + const Preset& preset = preset_bundle->printers.get_selected_preset(); + return preset.printer_technology() == ptSLA ? 1 : + preset.config.option("nozzle_diameter")->values.size(); +} + void GUI_App::window_pos_save(wxTopLevelWindow* window, const std::string &name) { if (name.empty()) { return; } diff --git a/src/slic3r/GUI/GUI_App.hpp b/src/slic3r/GUI/GUI_App.hpp index 4c23e3eb7..81ef3d040 100644 --- a/src/slic3r/GUI/GUI_App.hpp +++ b/src/slic3r/GUI/GUI_App.hpp @@ -163,6 +163,7 @@ public: Plater* plater_{ nullptr }; wxNotebook* tab_panel() const ; + int extruders_cnt() const; std::vector tabs_list; diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 7eef82063..d0f78a6da 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -51,8 +51,7 @@ static DynamicPrintConfig& printer_config() static int extruders_count() { - return printer_technology() == ptSLA ? 1 : - printer_config().option("nozzle_diameter")->values.size(); + return wxGetApp().extruders_cnt(); } ObjectList::ObjectList(wxWindow* parent) : diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index b5074ccc1..92b9c4171 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -295,8 +295,17 @@ wxBitmapComboBox(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(15 * wxGetApp().tab_panel()->ChangeSelection(page_id); - tab->select_preset(GetString(GetSelection()).ToUTF8().data()); + /* In a case of a multi-material printing, for editing another Filament Preset + * it's needed to select this preset for the "Filament settings" Tab + */ + if (preset_type == Preset::TYPE_FILAMENT && wxGetApp().extruders_cnt() > 1) + { + const std::string& selected_preset = GetString(GetSelection()).ToUTF8().data(); + // Call select_preset() only if there is new preset and not just modified + if ( !boost::algorithm::ends_with(selected_preset, "(modified)") ) + tab->select_preset(selected_preset); + } })); }