From e8214901d4821a20bbd37994e2742e5c20763cd8 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Wed, 31 Jan 2024 16:10:27 +0100 Subject: [PATCH] SLA overrides: Fixed preset update, when config is loaded from old PS + Config.cpp: Fixed comparison of nil values --- src/libslic3r/Config.hpp | 2 ++ src/slic3r/GUI/Plater.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/libslic3r/Config.hpp b/src/libslic3r/Config.hpp index b34b6af932..24bbe7a5b1 100644 --- a/src/libslic3r/Config.hpp +++ b/src/libslic3r/Config.hpp @@ -389,6 +389,8 @@ public: if (rhs.type() != this->type()) throw ConfigurationError("ConfigOptionSingle: Comparing incompatible types"); assert(dynamic_cast(&rhs)); + if (this->is_nil() && rhs.is_nil()) + return true; return this->value == static_cast(&rhs)->value; } diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index e3a184639f..dcb5a52491 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2640,6 +2640,8 @@ std::vector Plater::priv::load_files(const std::vector& input_ config.apply(loaded_printer_technology == ptFFF ? static_cast(FullPrintConfig::defaults()) : static_cast(SLAFullPrintConfig::defaults())); + // Set all the nullable values in defaults to nils. + config.null_nullables(); // and place the loaded config over the base. config += std::move(config_loaded); }