Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Turri <enricoturri@seznam.cz>2018-02-14 16:30:03 +0300
committerEnrico Turri <enricoturri@seznam.cz>2018-02-14 16:30:03 +0300
commitf5f27859e026876de2501f11219f29702483b20f (patch)
tree4ffe652287e6e81f5c7112b4d6295604359eeb35 /xs/src/libslic3r/Model.cpp
parentbacb36eb10848b4759c75a5d13a1de6fad7edfec (diff)
AMF I/O - Embedded config data + zip formatting
Diffstat (limited to 'xs/src/libslic3r/Model.cpp')
-rw-r--r--xs/src/libslic3r/Model.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/xs/src/libslic3r/Model.cpp b/xs/src/libslic3r/Model.cpp
index 891438407..f65707ccb 100644
--- a/xs/src/libslic3r/Model.cpp
+++ b/xs/src/libslic3r/Model.cpp
@@ -47,9 +47,9 @@ Model Model::read_from_file(const std::string &input_file, bool add_default_inst
result = load_stl(input_file.c_str(), &model);
else if (boost::algorithm::iends_with(input_file, ".obj"))
result = load_obj(input_file.c_str(), &model);
- else if (boost::algorithm::iends_with(input_file, ".amf") ||
- boost::algorithm::iends_with(input_file, ".amf.xml"))
- result = load_amf(input_file.c_str(), &model);
+ else if (!boost::algorithm::iends_with(input_file, ".zip.amf") && (boost::algorithm::iends_with(input_file, ".amf") ||
+ boost::algorithm::iends_with(input_file, ".amf.xml")))
+ result = load_amf(input_file.c_str(), nullptr, &model);
#ifdef SLIC3R_PRUS
else if (boost::algorithm::iends_with(input_file, ".prusa"))
result = load_prus(input_file.c_str(), &model);
@@ -79,8 +79,10 @@ Model Model::read_from_archive(const std::string &input_file, PresetBundle* bund
bool result = false;
if (boost::algorithm::iends_with(input_file, ".3mf"))
result = load_3mf(input_file.c_str(), bundle, &model);
+ else if (boost::algorithm::iends_with(input_file, ".zip.amf"))
+ result = load_amf(input_file.c_str(), bundle, &model);
else
- throw std::runtime_error("Unknown file format. Input file must have .3mf extension.");
+ throw std::runtime_error("Unknown file format. Input file must have .3mf or .zip.amf extension.");
if (!result)
throw std::runtime_error("Loading of a model file failed.");