From 4fab8d0b3955f9f96a263f4a0e55492089f6c62a Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sun, 30 Aug 2026 23:31:21 -0500 Subject: [PATCH] fix: adapt belt sub-layer group emission to upstream m_writer unique_ptr Upstream changed GCode::m_writer from a value to std::unique_ptr; the belt mixed_sub_layer_groups path still used value syntax and did not compile. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_012ChxXYc6Dp46qAN9c2rQCe --- src/libslic3r/GCode.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 682a387884..a030b589c4 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -7054,17 +7054,17 @@ LayerResult GCode::process_layer( } if (m_enable_exclude_object) { if (is_BBL_Printer()) { - m_writer.set_object_start_str( + m_writer->set_object_start_str( std::string("; start printing object, unique label id: ") + std::to_string(instance_to_print.label_object_id) + "\n" + "M624 " + _encode_label_ids_to_base64({instance_to_print.label_object_id}) + "\n"); } else { const auto gflavor = print.config().gcode_flavor.value; if (gflavor == gcfKlipper) { - m_writer.set_object_start_str(std::string("EXCLUDE_OBJECT_START NAME=") + + m_writer->set_object_start_str(std::string("EXCLUDE_OBJECT_START NAME=") + get_instance_name(&instance_to_print.print_object, inst.id) + "\n"); } else if (gflavor == gcfMarlinLegacy || gflavor == gcfMarlinFirmware || gflavor == gcfRepRapFirmware) { - m_writer.set_object_start_str(std::string("M486 S") + std::to_string(inst.unique_id) + "\n"); + m_writer->set_object_start_str(std::string("M486 S") + std::to_string(inst.unique_id) + "\n"); } } } @@ -7276,20 +7276,20 @@ LayerResult GCode::process_layer( } // --- Shared instance footer (mirrors Orca's main instance loop) --- - if (!m_writer.is_object_start_str_empty()) { - m_writer.set_object_start_str(""); + if (!m_writer->is_object_start_str_empty()) { + m_writer->set_object_start_str(""); } else if (m_enable_exclude_object) { if (is_BBL_Printer()) { - m_writer.set_object_end_str(std::string("; stop printing object, unique label id: ") + + m_writer->set_object_end_str(std::string("; stop printing object, unique label id: ") + std::to_string(instance_to_print.label_object_id) + "\n" + "M625\n"); } else { const auto gflavor = print.config().gcode_flavor.value; if (gflavor == gcfKlipper) { - m_writer.set_object_end_str(std::string("EXCLUDE_OBJECT_END NAME=") + + m_writer->set_object_end_str(std::string("EXCLUDE_OBJECT_END NAME=") + get_instance_name(&instance_to_print.print_object, inst.id) + "\n"); } else if (gflavor == gcfMarlinLegacy || gflavor == gcfMarlinFirmware || gflavor == gcfRepRapFirmware) { - m_writer.set_object_end_str(std::string("M486 S-1\n")); + m_writer->set_object_end_str(std::string("M486 S-1\n")); } } } @@ -7302,7 +7302,7 @@ LayerResult GCode::process_layer( // wipe tower's add_object_end_labels may consume it into a local temp string and the // M625 would be lost for BBL printers. if (!layer_tools.mixed_sub_layer_groups.empty()) { - m_writer.add_object_end_labels(gcode); + m_writer->add_object_end_labels(gcode); m_nominal_z = print_z; m_need_change_layer_lift_z = true; }