diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index efcf9610b..ae7c73542 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -1905,6 +1905,7 @@ std::vector GCode::sort_print_object_instances( } std::string GCode::emit_custom_gcode_per_print_z( + GCode &gcodegen, const CustomGCode::Item *custom_gcode, // ID of the first extruder printing this layer. uint16_t first_extruder_id, @@ -1966,6 +1967,10 @@ std::string GCode::emit_custom_gcode_per_print_z( } else { gcode += print.config().color_change_gcode;//ColorChangeCode; gcode += "\n"; + //FIXME Tell G-code writer that M600 filled the extruder, thus the G-code writer shall reset the extruder to unretracted state after + // return from M600. Thus the G-code generated by the following line is ignored. + // see GH issue #6362 + gcodegen.writer().unretract(); } } else { if (gcode_type == CustomGCode::PausePrint) // Pause print @@ -2186,7 +2191,7 @@ void GCode::process_layer( if (single_object_instance_idx == size_t(-1)) { // Normal (non-sequential) print. - gcode += this->emit_custom_gcode_per_print_z(layer_tools.custom_gcode, first_extruder_id, print, print_stat); + gcode += this->emit_custom_gcode_per_print_z(*this, layer_tools.custom_gcode, first_extruder_id, print, print_stat); } // Extrude skirt at the print_z of the raft layers and normal object layers // not at the print_z of the interlaced support material layers. diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 7562f5306..9559a8a6b 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -183,7 +183,7 @@ public: static void append_full_config(const Print& print, std::string& str); // called by porcess_layer, do the color change / custom gcode - std::string emit_custom_gcode_per_print_z(const CustomGCode::Item* custom_gcode, uint16_t first_extruder_id, const Print& print, PrintStatistics& stats); + std::string emit_custom_gcode_per_print_z(GCode& gcodegen, const CustomGCode::Item* custom_gcode, uint16_t first_extruder_id, const Print& print, PrintStatistics& stats); // Object and support extrusions of the same PrintObject at the same print_z. // public, so that it could be accessed by free helper functions from GCode.cpp