From 409849d238718b75cf0c5ef264ce1df0cedc5c6e Mon Sep 17 00:00:00 2001
From: YuSanka <yusanka@gmail.com>
Date: Mon, 1 Mar 2021 16:32:47 +0100
Subject: [PATCH] Fixed loading of the project file with filament which is not
 installed for the selected printers If loaded filaments are
 invisible/non-instaled, set them as visible

---
 src/libslic3r/PresetBundle.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp
index 7d08c9359..dc52fdaff 100644
--- a/src/libslic3r/PresetBundle.cpp
+++ b/src/libslic3r/PresetBundle.cpp
@@ -876,6 +876,17 @@ void PresetBundle::load_config_file_config(const std::string &name_or_path, bool
                 this->filament_presets[i] = loaded->name;
             }
         }
+
+        // 3.1) If loaded filaments are invisible/non-instaled, set them as visible
+        for (const std::string& filament : this->filament_presets) {
+            Preset* preset = this->filaments.find_preset(filament);
+            if (preset && !preset->is_visible) {
+                preset->is_visible = true;
+                if (preset->name == this->filaments.m_edited_preset.name)
+                    this->filaments.get_selected_preset().is_visible = true;
+            }
+        }
+
         // 4) Load the project config values (the per extruder wipe matrix etc).
         this->project_config.apply_only(config, s_project_options);