From 0997825e0e3a779fcfa9a59d3bb7d530d3f78e30 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Thu, 3 Jan 2019 12:04:14 +0100 Subject: [PATCH] Fixed import from amf files --- src/slic3r/GUI/Plater.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index bb5eec204..179aa9476 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -936,6 +936,7 @@ struct Plater::priv static const std::regex pattern_bundle; static const std::regex pattern_3mf; static const std::regex pattern_zip_amf; + static const std::regex pattern_any_amf; priv(Plater *q, MainFrame *main_frame); @@ -1051,6 +1052,8 @@ private: const std::regex Plater::priv::pattern_bundle(".*[.](amf|amf[.]xml|zip[.]amf|3mf|prusa)", std::regex::icase); const std::regex Plater::priv::pattern_3mf(".*3mf", std::regex::icase); const std::regex Plater::priv::pattern_zip_amf(".*[.]zip[.]amf", std::regex::icase); +const std::regex Plater::priv::pattern_any_amf(".*[.](amf|amf[.]xml|zip[.]amf)", std::regex::icase); + Plater::priv::priv(Plater *q, MainFrame *main_frame) : q(q) , main_frame(main_frame) @@ -1400,6 +1403,7 @@ std::vector Plater::priv::load_files(const std::vector& input_ const bool type_3mf = std::regex_match(path.string(), pattern_3mf); const bool type_zip_amf = !type_3mf && std::regex_match(path.string(), pattern_zip_amf); + const bool type_any_amf = !type_3mf && std::regex_match(path.string(), pattern_any_amf); Slic3r::Model model; try { @@ -1455,7 +1459,7 @@ std::vector Plater::priv::load_files(const std::vector& input_ } } - if (type_3mf) { + if (type_3mf || type_any_amf) { for (ModelObject* model_object : model.objects) { model_object->center_around_origin(); model_object->ensure_on_bed();