From e8926efbe33430680ce1d33c511c8029720036ef Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Thu, 24 Sep 2026 19:42:44 -0500 Subject: [PATCH] Belt purge: detect filament changes by scanning the ordering, not the first layer's flag ToolOrdering::has_wipe_tower() reads the first layer's flag. On a belt the first layer may be a brim apron band, which carries neither object nor support and never gets the flag, so with a brim the purge plan returned early and nothing was purged. Scan the layers for a change. --- src/libslic3r/BeltPurge.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/BeltPurge.cpp b/src/libslic3r/BeltPurge.cpp index 37d89ca14e..bba338b878 100644 --- a/src/libslic3r/BeltPurge.cpp +++ b/src/libslic3r/BeltPurge.cpp @@ -165,9 +165,18 @@ void Print::_plan_belt_purge() if (m_wipe_tower_data.tool_ordering.empty() || m_wipe_tower_data.tool_ordering.last_extruder() == unsigned(-1)) throw Slic3r::SlicingError("The print is empty. The model is not printable with current print settings."); - if (!m_wipe_tower_data.tool_ordering.has_wipe_tower()) - // No toolchanges anywhere, nothing to purge. - return; + // Is there any filament change at all? Not ToolOrdering::has_wipe_tower(): that reads the + // FIRST layer's flag, and on a belt the first layer may be a brim apron band, which carries + // neither object nor support and so never gets the flag even when the print changes filament. + { + bool any_change = false; + unsigned int cur = m_wipe_tower_data.tool_ordering.first_extruder(); + for (const auto < : m_wipe_tower_data.tool_ordering.layer_tools()) + for (const unsigned int e : lt.extruders) + if (e != cur) { any_change = true; cur = e; } + if (! any_change) + return; + } this->throw_if_canceled();