From 225095d938f889914c24d7b501debb1950ad98ee Mon Sep 17 00:00:00 2001 From: Stone Li Date: Fri, 7 Jul 2023 20:27:21 +0800 Subject: [PATCH] FIX: fix bed type error when loading from project Change-Id: I13a6f46e4516f5237b006fff848ef5e75bbb30de Signed-off-by: Stone Li --- src/slic3r/GUI/Plater.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 01bfa1d72c..6e4ae0c224 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3394,6 +3394,20 @@ std::vector Plater::priv::load_files(const std::vector& input_ } } else { preset_bundle->load_config_model(filename.string(), std::move(config), file_version); + + ConfigOption* bed_type_opt = preset_bundle->project_config.option("curr_bed_type"); + if (bed_type_opt != nullptr) { + BedType bed_type = (BedType)bed_type_opt->getInt(); + // update app config for bed type + bool is_bbl_preset = preset_bundle->printers.get_edited_preset().is_bbl_vendor_preset(&(*preset_bundle)); + if (is_bbl_preset) { + AppConfig* app_config = wxGetApp().app_config; + if (app_config) + app_config->set("curr_bed_type", std::to_string(int(bed_type))); + } + q->on_bed_type_change(bed_type); + } + // BBS: moved this logic to presetcollection //{ // // After loading of the presets from project, check if they are visible. @@ -3453,9 +3467,6 @@ std::vector Plater::priv::load_files(const std::vector& input_ // to avoid black (default) colors for Extruders in the ObjectList, // when for extruder colors are used filament colors q->on_filaments_change(preset_bundle->filament_presets.size()); - - ConfigOption *bed_type_opt = preset_bundle->project_config.option("curr_bed_type"); - if (bed_type_opt != nullptr) q->on_bed_type_change((BedType) bed_type_opt->getInt()); is_project_file = true; } }