From aef9ca2efb54df9a8ae020fc53d5a7bec359c229 Mon Sep 17 00:00:00 2001 From: Kiss Lorand <50251547+kisslorand@users.noreply.github.com> Date: Mon, 14 Sep 2026 01:42:49 +0300 Subject: [PATCH] Fix label object error for toolchanges without object instances (#15666) --- src/libslic3r/GCode.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index e9cdb620e0..4aa45a60ed 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -6308,8 +6308,13 @@ LayerResult GCode::process_layer( all_label_ids.insert(inst.label_object_id); break; } - std::vector filament_instances_id(all_label_ids.begin(), all_label_ids.end()); - m_filament_instances_code = _encode_label_ids_to_base64(filament_instances_id); + // Orca: A scheduled extruder may have no object instances on this layer. + // Clear any pending mask so it cannot be emitted for the wrong toolchange. + m_filament_instances_code.clear(); + if (!all_label_ids.empty()) { + std::vector filament_instances_id(all_label_ids.begin(), all_label_ids.end()); + m_filament_instances_code = _encode_label_ids_to_base64(filament_instances_id); + } } // The inline _extrude hook may already have taken the snapshot mid-extrusion on a