From bb31e912efc5b921a4dca53739f26941846af609 Mon Sep 17 00:00:00 2001 From: "maosheng.wei" Date: Tue, 7 Nov 2023 09:22:40 +0800 Subject: [PATCH] FIX: Generate UUID from objectID and volumeIndex Jira: XXXX Change-Id: I65147ef9b695f8af8de260d722e604b0e0bab563 Signed-off-by: maosheng.wei --- src/libslic3r/Format/bbs_3mf.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/Format/bbs_3mf.cpp b/src/libslic3r/Format/bbs_3mf.cpp index 504eaab9e..69dd1e26e 100644 --- a/src/libslic3r/Format/bbs_3mf.cpp +++ b/src/libslic3r/Format/bbs_3mf.cpp @@ -6411,7 +6411,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) else stream << " <" << COMPONENT_TAG << " p:path=\"" << xml_escape(*ppath) << "\" objectid=\"" << volume_id; // << "\"/>\n"; if (m_production_ext) - stream << "\" " << PUUID_ATTR << "=\"" << hex_wrap{(boost::uint32_t) (volume_id + (object_data.backup_id << 16))} << COMPONENT_UUID_SUFFIX; + stream << "\" " << PUUID_ATTR << "=\"" << hex_wrap{(boost::uint32_t) (index + (object_data.backup_id << 16))} << COMPONENT_UUID_SUFFIX; const Transform3d &transf = volume->get_matrix(); stream << "\" " << TRANSFORM_ATTR << "=\""; for (unsigned c = 0; c < 4; ++c) { @@ -6509,7 +6509,8 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) char buf[256]; unsigned int vertices_count = 0; //unsigned int triangles_count = 0; - for (ModelVolume* volume : object.volumes) { + for (unsigned int index = 0; index < object.volumes.size(); index++) { + ModelVolume *volume = object.volumes[index]; if (volume == nullptr) continue; @@ -6536,7 +6537,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) if (m_production_ext) { std::stringstream stream; reset_stream(stream); - stream << "\" " << PUUID_ATTR << "=\"" << hex_wrap{(boost::uint32_t) (volume_id + (object_data.backup_id << 16))} << SUB_OBJECT_UUID_SUFFIX; + stream << "\" " << PUUID_ATTR << "=\"" << hex_wrap{(boost::uint32_t) (index + (object_data.backup_id << 16))} << SUB_OBJECT_UUID_SUFFIX; //output_buffer += "\" "; //output_buffer += PUUID_ATTR; //output_buffer += "=\"";