From ec309e1cc6e946cb2effbfb9f2a23daad2030b89 Mon Sep 17 00:00:00 2001 From: Clifford Garwood Date: Fri, 7 Aug 2026 12:01:04 -0400 Subject: [PATCH] fix(imex): apply the same-physical cool-down skip only on IMEX printers set_extruder skips the ooze-prevention standby cool-down when the outgoing and incoming filament route to the same physical extruder. That is an IMEX behaviour -- an AFC/MMU lane swap keeps the same heater selected -- but the check was not gated, so it ran on every printer. 73 shipping profiles enable ooze_prevention by default (37 Snapmaker, 21 WonderMaker, 9 Flashforge, plus Lulzbot, Prusa, re3D, iQ and the MyToolChanger), and the 150 multi-nozzle machines behind them author no physical_extruder_map. They were spared only because every one declares a single variant per extruder, so the map came out as the identity and nothing was ever suppressed. Correctness should not rest on that. Gate on is_imex. Verified on one fixture with only is_imex differing, with two filaments mapped to the same physical extruder: 0 cool-downs emitted with it on, 26 with it off. Co-Authored-By: Claude Opus 5 (1M context) --- src/libslic3r/GCode.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index a6a8da0edb..18c8666dd0 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -9228,15 +9228,19 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo // If ooze prevention is enabled, park current extruder in the nearest // standby point and set it to the standby temperature. // - // Same-physical short-circuit: skip the standby cool-down when the old and - // new filament both route to the same physical extruder via - // physical_extruder_map (AFC/MMU lane swaps where the active heater stays - // selected, just a different lane is loaded). The cool-down → re-heat - // round trip is pointless in that case — same nozzle, same heater, just a - // different filament feeding it. post_toolchange below still emits M109 - // to the new filament's print temp, so per-lane temperature differences - // (e.g. PLA lane → PETG lane on the same AFC manifold) are still handled. + // Same-physical short-circuit: on an IMEX printer, skip the standby cool-down when the + // old and new filament both route to the same physical extruder via physical_extruder_map + // (AFC/MMU lane swaps where the active heater stays selected and only the lane changes). + // The cool-down → re-heat round trip is pointless there — same nozzle, same heater, just a + // different filament feeding it. post_toolchange below still emits M109 to the new + // filament's print temp, so per-lane temperature differences are still handled. + // + // Gated on is_imex so ooze prevention behaves exactly as upstream on every other printer. + // 73 shipping profiles enable it by default (Snapmaker, Flashforge, Prusa and others) and + // none of them are asking for this optimisation. auto same_physical_extruder = [&](int a, int b) { + if (!m_config.is_imex.value) + return false; const auto& pem = m_config.physical_extruder_map.values; return !pem.empty() && a >= 0 && b >= 0 && a < (int)pem.size() && b < (int)pem.size()