From 41b1dc3d80d43f4a2df141edd3d4b5bd1ee24ce1 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Thu, 6 Aug 2020 14:05:42 +0200 Subject: [PATCH] Fix of custom supports 3MF loading Multiple-part objects were not handled correctly --- src/libslic3r/Format/3mf.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/Format/3mf.cpp b/src/libslic3r/Format/3mf.cpp index 3612e6898..59dc85a0a 100644 --- a/src/libslic3r/Format/3mf.cpp +++ b/src/libslic3r/Format/3mf.cpp @@ -1878,10 +1878,11 @@ namespace Slic3r { volume->calculate_convex_hull(); // recreate custom supports from previously loaded attribute - assert(geometry.custom_supports.size() == triangles_count); for (unsigned i=0; im_supported_facets.set_triangle_from_string(i, geometry.custom_supports[i]); + size_t index = src_start_id/3 + i; + assert(index < geometry.custom_supports.size()); + if (! geometry.custom_supports[index].empty()) + volume->m_supported_facets.set_triangle_from_string(i, geometry.custom_supports[index]); } // apply the remaining volume's metadata