diff --git a/xs/src/libslic3r/Model.cpp b/xs/src/libslic3r/Model.cpp index f65707ccb..1de99bbf8 100644 --- a/xs/src/libslic3r/Model.cpp +++ b/xs/src/libslic3r/Model.cpp @@ -12,6 +12,7 @@ #include #include #include +#include namespace Slic3r { @@ -91,7 +92,15 @@ Model Model::read_from_archive(const std::string &input_file, PresetBundle* bund throw std::runtime_error("The supplied file couldn't be read because it's empty"); for (ModelObject *o : model.objects) - o->input_file = input_file; + { + if (boost::algorithm::iends_with(input_file, ".zip.amf")) + { + // we remove the .zip part of the extension to avoid it be added to filenames when exporting + o->input_file = boost::ireplace_last_copy(input_file, ".zip.", "."); + } + else + o->input_file = input_file; + } if (add_default_instances) model.add_default_instances();