Added version check for .3mf and .amf project files. PrusaSlicer will refuse to import files with newer version numbers.

This commit is contained in:
Enrico Turri 2019-08-23 13:12:31 +02:00
parent 058a1d9a98
commit c7cdb2fd3e
7 changed files with 62 additions and 31 deletions

View file

@ -2215,7 +2215,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
DynamicPrintConfig config;
{
DynamicPrintConfig config_loaded;
model = Slic3r::Model::read_from_archive(path.string(), &config_loaded, false);
model = Slic3r::Model::read_from_archive(path.string(), &config_loaded, false, load_config);
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);
@ -2255,7 +2255,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
}
}
else {
model = Slic3r::Model::read_from_file(path.string(), nullptr, false);
model = Slic3r::Model::read_from_file(path.string(), nullptr, false, load_config);
for (auto obj : model.objects)
if (obj->name.empty())
obj->name = fs::path(obj->input_file).filename().string();