Fix per-plate bed type handling (#15916)

This commit is contained in:
Kiss Lorand authored and GitHub committed 2026-10-02 21:02:36 -03:00
1 parent eb30ea1eb8
commit 1241dd5521
9 files changed
+101 -7

No files matched your search

+22 -1
View File
@@ -3,6 +3,7 @@
#include "ParamsPanel.hpp"
#include "GUI_App.hpp"
#include "MainFrame.hpp"
#include "Plater.hpp"
#include "Tab.hpp"
#include "libslic3r/Utils.hpp"
@@ -70,6 +71,18 @@ ParamsDialog::ParamsDialog(wxWindow * parent)
}
Hide();
if (tab && tab->type() == Preset::TYPE_PRINTER) {
// Normalize only after the dialog closes, when the final capability is known.
auto &preset_bundle = *wxGetApp().preset_bundle;
const bool supports_multiple_bed_types = preset_bundle.is_bbl_vendor() ||
preset_bundle.printers.get_edited_preset().config.opt_bool("support_multi_bed_types");
if (m_initial_multi_bed_types != supports_multiple_bed_types) {
wxGetApp().plater()->normalize_bed_types(true);
if (auto *plate_tab = dynamic_cast<TabPrintPlate *>(wxGetApp().get_plate_tab()))
plate_tab->update_model_config();
}
}
if (!m_editing_filament_id.empty()) {
Filamentinformation *filament_info = new Filamentinformation();
filament_info->filament_id = m_editing_filament_id;
@@ -93,7 +106,15 @@ void ParamsDialog::Popup()
if (m_panel && m_panel->get_current_tab()) {
bool just_edit = false;
if (!m_editing_filament_id.empty()) just_edit = true;
dynamic_cast<Tab *>(m_panel->get_current_tab())->set_just_edit(just_edit);
auto *tab = dynamic_cast<Tab *>(m_panel->get_current_tab());
tab->set_just_edit(just_edit);
if (tab->type() == Preset::TYPE_PRINTER) {
// Remember the initial capability and compare it when the dialog closes.
// Bambu profiles support multiple bed types even when this option is unset.
auto &preset_bundle = *wxGetApp().preset_bundle;
m_initial_multi_bed_types = preset_bundle.is_bbl_vendor() ||
preset_bundle.printers.get_edited_preset().config.opt_bool("support_multi_bed_types");
}
}
Show();
}