From 5454a65c8d010c0924f37dedbc00a45fe6d671a0 Mon Sep 17 00:00:00 2001 From: "zhimin.zeng" Date: Wed, 7 Dec 2022 17:51:52 +0800 Subject: [PATCH] FIX: reopen 3mf file the position of assemble model is not right Change-Id: I880913c48dde297decac25e5f3c41afacdaf36dc --- src/libslic3r/Format/bbs_3mf.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/Format/bbs_3mf.cpp b/src/libslic3r/Format/bbs_3mf.cpp index 1c8683faf..b99eb3dcc 100644 --- a/src/libslic3r/Format/bbs_3mf.cpp +++ b/src/libslic3r/Format/bbs_3mf.cpp @@ -3134,8 +3134,10 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) } else if (m_curr_metadata_name == BBL_APPLICATION_TAG) { // Generator application of the 3MF. // SLIC3R_APP_KEY - SLIC3R_VERSION - if (boost::starts_with(m_curr_characters, "BambuStudio-")) + if (boost::starts_with(m_curr_characters, "BambuStudio-")) { + m_is_bbl_3mf = true; m_bambuslicer_generator_version = Semver::parse(m_curr_characters.substr(12)); + } //TODO: currently use version 0, no need to load&&save this string /*} else if (m_curr_metadata_name == BBS_FDM_SUPPORTS_PAINTING_VERSION) { m_fdm_supports_painting_version = (unsigned int) atoi(m_curr_characters.c_str()); @@ -3853,7 +3855,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) TriangleMesh triangle_mesh(std::move(its), volume_data->mesh_stats); - if (m_version == 0) { + if (!m_is_bbl_3mf) { // if the 3mf was not produced by BambuStudio and there is only one instance, // bake the transformation into the geometry to allow the reload from disk command // to work properly @@ -5408,7 +5410,6 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) } // remember to use metadata_item_map to store metadata info std::map metadata_item_map; - metadata_item_map[BBS_3MF_VERSION] = std::to_string(VERSION_BBS_3MF); if (!sub_model) { // update metadat_items if (model.model_info && model.model_info.get()) { @@ -5436,6 +5437,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) metadata_item_map[BBL_MODIFICATION_TAG] = date; metadata_item_map[BBL_APPLICATION_TAG] = (boost::format("%1%-%2%") % SLIC3R_APP_KEY % SLIC3R_VERSION).str(); } + metadata_item_map[BBS_3MF_VERSION] = std::to_string(VERSION_BBS_3MF); // store metadata info for (auto item : metadata_item_map) {