From 5ca85c6fc64ae1481c729bd7de63d5b68dcac588 Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Wed, 27 Nov 2024 12:28:51 +0800 Subject: [PATCH] FIX:add xmlns:BambuStudio in model_settings.config jira: none Change-Id: I703b8cef7fc591fc84496e4c383cac4a4d543bda --- src/libslic3r/Format/bbs_3mf.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/Format/bbs_3mf.cpp b/src/libslic3r/Format/bbs_3mf.cpp index bd282efc8..811b42993 100644 --- a/src/libslic3r/Format/bbs_3mf.cpp +++ b/src/libslic3r/Format/bbs_3mf.cpp @@ -369,7 +369,8 @@ static constexpr const char *FONT_STYLE_ATTR = "style"; static constexpr const char *FONT_WEIGHT_ATTR = "weight"; // Store / load of EmbossShape -static constexpr const char *SHAPE_TAG = "slic3rpe:shape"; +static constexpr const char *OLD_SHAPE_TAG = "slic3rpe:shape"; +static constexpr const char *SHAPE_TAG = "BambuStudio:shape"; static constexpr const char *SHAPE_SCALE_ATTR = "scale"; static constexpr const char *UNHEALED_ATTR = "unhealed"; static constexpr const char *SVG_FILE_PATH_ATTR = "filepath"; @@ -3252,6 +3253,8 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) res = _handle_start_assemble_item(attributes, num_attributes); else if (::strcmp(TEXT_INFO_TAG, name) == 0) res = _handle_start_text_info_item(attributes, num_attributes); + else if (::strcmp(OLD_SHAPE_TAG, name) == 0) + res = _handle_start_shape_configuration(attributes, num_attributes); else if (::strcmp(SHAPE_TAG, name) == 0) res = _handle_start_shape_configuration(attributes, num_attributes); if (!res) @@ -7351,7 +7354,10 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) // when loaded as accurately as possible. stream << std::setprecision(std::numeric_limits::max_digits10); stream << "\n"; - stream << "<" << CONFIG_TAG << ">\n"; + stream << "<" << CONFIG_TAG + << " xml:lang=\"en-US\" xmlns=\"http://schemas.microsoft.com/3dmanufacturing/core/2015/02\" " + "xmlns:BambuStudio=\"http://schemas.bambulab.com/package/2021\""; + stream << ">\n"; if (!m_skip_model) for (const ObjectToObjectDataMap::value_type& obj_metadata : objects_data) { @@ -8635,7 +8641,7 @@ bool to_xml(std::stringstream &stream, const EmbossShape::SvgFile &svg, const Mo void to_xml(std::stringstream &stream, const EmbossShape &es, const ModelVolume &volume, mz_zip_archive &archive) { - stream << " <" << SHAPE_TAG << " "; + stream << " <" << SHAPE_TAG << " "; if (es.svg_file.has_value()) if (!to_xml(stream, *es.svg_file, volume, archive)) BOOST_LOG_TRIVIAL(warning) << "Can't write svg file defiden embossed shape into 3mf";