From 871311c95c704559c5a7b793d22e634f74909377 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Mon, 15 Nov 2021 10:47:35 +0100 Subject: [PATCH 1/3] Fix for #7301 - Endless loop telling me 'Supports work better if the following feature is enabled: bridging perimeters' when setting 'generate support material' on a single object This bug was from https://github.com/prusa3d/PrusaSlicer/commit/0c29eb9943df769ed045bd88f159406ecf9763ed --- src/slic3r/GUI/ConfigManipulation.cpp | 6 +++--- src/slic3r/GUI/ConfigManipulation.hpp | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 0b2af37b8e..7e64abcde1 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -162,8 +162,8 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con if (config->opt_bool("support_material")) { // Ask only once. - if (!m_support_material_overhangs_queried) { - m_support_material_overhangs_queried = true; + if (!support_material_overhangs_queried) { + support_material_overhangs_queried = true; if (!config->opt_bool("overhangs")/* != 1*/) { wxString msg_text = _(L("Supports work better, if the following feature is enabled:\n" "- Detect bridging perimeters")); @@ -182,7 +182,7 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con } } else { - m_support_material_overhangs_queried = false; + support_material_overhangs_queried = false; } if (config->option("fill_density")->value == 100) { diff --git a/src/slic3r/GUI/ConfigManipulation.hpp b/src/slic3r/GUI/ConfigManipulation.hpp index 0b50c8ab0f..0d6250b5af 100644 --- a/src/slic3r/GUI/ConfigManipulation.hpp +++ b/src/slic3r/GUI/ConfigManipulation.hpp @@ -17,11 +17,14 @@ class ModelConfig; namespace GUI { +// This variable have to be static because of use its value from Preset configuration +// and from object/parts configuration from the Settings in sidebar +static bool support_material_overhangs_queried {false}; + class ConfigManipulation { bool is_msg_dlg_already_exist{ false }; - bool m_support_material_overhangs_queried{false}; bool m_is_initialized_support_material_overhangs_queried{ false }; // function to loading of changed configuration @@ -63,7 +66,7 @@ public: void initialize_support_material_overhangs_queried(bool queried) { m_is_initialized_support_material_overhangs_queried = true; - m_support_material_overhangs_queried = queried; + support_material_overhangs_queried = queried; } }; From b431fd1f7ea2ae7bbb5034869f9b2b509511e06f Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Mon, 15 Nov 2021 11:11:48 +0100 Subject: [PATCH 2/3] Mark the source of nanosvg library --- src/nanosvg/README-prusa.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/nanosvg/README-prusa.txt diff --git a/src/nanosvg/README-prusa.txt b/src/nanosvg/README-prusa.txt new file mode 100644 index 0000000000..8388aa8ef3 --- /dev/null +++ b/src/nanosvg/README-prusa.txt @@ -0,0 +1 @@ +Upstream source: https://github.com/memononen/nanosvg/tree/c1f6e209c16b18b46aa9f45d7e619acf42c29726 \ No newline at end of file From 6ebd58e7a00a26bad7d8169e050e051ae5e3df24 Mon Sep 17 00:00:00 2001 From: David Kocik Date: Mon, 15 Nov 2021 12:59:51 +0100 Subject: [PATCH 3/3] Notice dialog about no default materials in printer profile. --- src/slic3r/GUI/ConfigWizard.cpp | 40 ++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/src/slic3r/GUI/ConfigWizard.cpp b/src/slic3r/GUI/ConfigWizard.cpp index 2ddee6e865..85268fca15 100644 --- a/src/slic3r/GUI/ConfigWizard.cpp +++ b/src/slic3r/GUI/ConfigWizard.cpp @@ -2292,26 +2292,54 @@ void ConfigWizard::priv::select_default_materials_for_printer_models(Technology { PageMaterials *page_materials = technology & T_FFF ? page_filaments : page_sla_materials; const std::string &appconfig_section = page_materials->materials->appconfig_section(); - - auto select_default_materials_for_printer_page = [this, appconfig_section, printer_models](PagePrinters *page_printers, Technology technology) + + // Following block was unnecessary. Its enough to iterate printer_models once. Not for every vendor printer page. + // Filament is selected on same page for all printers of same technology. + /* + auto select_default_materials_for_printer_page = [this, appconfig_section, printer_models, technology](PagePrinters *page_printers, Technology technology) { const std::string vendor_id = page_printers->get_vendor_id(); for (auto& pair : bundles) if (pair.first == vendor_id) - for (const VendorProfile::PrinterModel *printer_model : printer_models) - for (const std::string &material : printer_model->default_materials) - appconfig_new.set(appconfig_section, material, "1"); + for (const VendorProfile::PrinterModel *printer_model : printer_models) + for (const std::string &material : printer_model->default_materials) + appconfig_new.set(appconfig_section, material, "1"); }; PagePrinters* page_printers = technology & T_FFF ? page_fff : page_msla; select_default_materials_for_printer_page(page_printers, technology); - for (const auto& printer : pages_3rdparty) + for (const auto& printer : pages_3rdparty) { page_printers = technology & T_FFF ? printer.second.first : printer.second.second; if (page_printers) select_default_materials_for_printer_page(page_printers, technology); } + */ + + // Iterate printer_models and select default materials. If none available -> msg to user. + std::vector models_without_default; + for (const VendorProfile::PrinterModel* printer_model : printer_models) { + if (printer_model->default_materials.empty()) { + models_without_default.emplace_back(printer_model); + } else { + for (const std::string& material : printer_model->default_materials) + appconfig_new.set(appconfig_section, material, "1"); + } + } + + if (!models_without_default.empty()) { + std::string printer_names = "\n\n"; + for (const VendorProfile::PrinterModel* printer_model : models_without_default) { + printer_names += printer_model->name + "\n"; + } + printer_names += "\n\n"; + std::string message = (technology & T_FFF ? + GUI::format(_L("Following printer profiles has no default filament: %1%Please select one manually."), printer_names) : + GUI::format(_L("Following printer profiles has no default material: %1%Please select one manually."), printer_names)); + MessageDialog msg(q, message, _L("Notice"), wxOK); + msg.ShowModal(); + } update_materials(technology); ((technology & T_FFF) ? page_filaments : page_sla_materials)->reload_presets();