diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 744484765b..db958482c7 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -7971,7 +7971,23 @@ 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. - if (m_ooze_prevention.enable && m_writer.filament() != nullptr) + // + // 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. + auto same_physical_extruder = [&](int a, int b) { + const auto& pem = m_config.physical_extruder_map.values; + return !pem.empty() && a >= 0 && b >= 0 + && a < (int)pem.size() && b < (int)pem.size() + && pem[a] == pem[b]; + }; + if (m_ooze_prevention.enable && m_writer.filament() != nullptr + && !same_physical_extruder(m_writer.filament()->id(), (int)new_filament_id)) gcode += m_ooze_prevention.pre_toolchange(*this); // BBS