From 874da0281de52fd5ce17d3ff1e8798bff1c28242 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Mon, 7 Feb 2022 10:00:49 +0100 Subject: [PATCH] Fixed SPE-1192 Wrong list of SLA-materials, when no SLA-printer is installed, but 3MF with SLA print is loaded --- src/libslic3r/Preset.cpp | 2 ++ src/slic3r/GUI/Plater.cpp | 11 ++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index e65b604df..5ab3142e6 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -412,6 +412,8 @@ void Preset::set_visible_from_appconfig(const AppConfig &app_config) for (auto it = this->renamed_from.begin(); ! is_visible && it != this->renamed_from.end(); ++ it) is_visible = has(*it); } + else + is_visible = false; } } diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 26aef38ff..c9a55e2b2 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2409,16 +2409,17 @@ std::vector Plater::priv::load_files(const std::vector& input_ try { if (type_3mf || type_zip_amf) { DynamicPrintConfig config; + PrinterTechnology loaded_printer_technology; { DynamicPrintConfig config_loaded; ConfigSubstitutionContext config_substitutions{ ForwardCompatibilitySubstitutionRule::Enable }; model = Slic3r::Model::read_from_archive(path.string(), &config_loaded, &config_substitutions, only_if(load_config, Model::LoadAttribute::CheckVersion)); if (load_config && !config_loaded.empty()) { // Based on the printer technology field found in the loaded config, select the base for the config, - PrinterTechnology printer_technology = Preset::printer_technology(config_loaded); + loaded_printer_technology = Preset::printer_technology(config_loaded); // We can't to load SLA project if there is at least one multi-part object on the bed - if (printer_technology == ptSLA) { + if (loaded_printer_technology == ptSLA) { const ModelObjectPtrs& objects = q->model().objects; for (auto object : objects) if (object->volumes.size() > 1) { @@ -2430,7 +2431,7 @@ std::vector Plater::priv::load_files(const std::vector& input_ } } - config.apply(printer_technology == ptFFF ? + config.apply(loaded_printer_technology == ptFFF ? static_cast(FullPrintConfig::defaults()) : static_cast(SLAFullPrintConfig::defaults())); // and place the loaded config over the base. @@ -2461,7 +2462,7 @@ std::vector Plater::priv::load_files(const std::vector& input_ }; std::vector names; - if (printer_technology == ptFFF) { + if (loaded_printer_technology == ptFFF) { update_selected_preset_visibility(preset_bundle->prints, names); for (const std::string& filament : preset_bundle->filament_presets) { Preset* preset = preset_bundle->filaments.find_preset(filament); @@ -2492,7 +2493,7 @@ std::vector Plater::priv::load_files(const std::vector& input_ } } - if (printer_technology == ptFFF) + if (loaded_printer_technology == ptFFF) CustomGCode::update_custom_gcode_per_print_z_from_config(model.custom_gcode_per_print_z, &preset_bundle->project_config); // For exporting from the amf/3mf we shouldn't check printer_presets for the containing information about "Print Host upload"