SLA overrides: Fixed preset update, when config is loaded from old PS

+ Config.cpp: Fixed comparison of nil values
This commit is contained in:
YuSanka 2024-01-31 16:10:27 +01:00
parent 91e67e2e16
commit e8214901d4
2 changed files with 4 additions and 0 deletions

View File

@ -389,6 +389,8 @@ public:
if (rhs.type() != this->type())
throw ConfigurationError("ConfigOptionSingle: Comparing incompatible types");
assert(dynamic_cast<const ConfigOptionSingle*>(&rhs));
if (this->is_nil() && rhs.is_nil())
return true;
return this->value == static_cast<const ConfigOptionSingle*>(&rhs)->value;
}

View File

@ -2640,6 +2640,8 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
config.apply(loaded_printer_technology == ptFFF ?
static_cast<const ConfigBase&>(FullPrintConfig::defaults()) :
static_cast<const ConfigBase&>(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);
}