diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index bf1d24e8a..8e48a56d6 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -201,12 +201,13 @@ std::string WipeTowerIntegration::append_tcr(GCode &gcodegen, const WipeTower::T // Let the m_writer know the current extruder_id, but ignore the generated G-code. if (new_extruder_id >= 0 && gcodegen.writer().need_toolchange(new_extruder_id)) gcodegen.writer().toolchange(new_extruder_id); + gcodegen.placeholder_parser().set("current_extruder", new_extruder_id); + // Always append the filament start G-code even if the extruder did not switch, // because the wipe tower resets the linear advance and we want it to be re-enabled. const std::string &start_filament_gcode = gcodegen.config().start_filament_gcode.get_at(new_extruder_id); if (! start_filament_gcode.empty()) { // Process the start_filament_gcode for the active filament only. - gcodegen.placeholder_parser().set("current_extruder", new_extruder_id); DynamicConfig config; config.set_key_value("filament_extruder_id", new ConfigOptionInt(new_extruder_id)); gcode += gcodegen.placeholder_parser_process("start_filament_gcode", start_filament_gcode, new_extruder_id, &config);