diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 1fd6506b3b..6697876087 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -1247,6 +1247,9 @@ void GCodeGenerator::_do_export(Print& print, GCodeOutputStream &file, Thumbnail m_enable_cooling_markers = false; // we're not filtering these moves through CoolingBuffer m_avoid_crossing_perimeters.use_external_mp_once(); file.write(this->retract_and_wipe()); + file.write(m_label_objects.maybe_stop_instance()); + const double last_z{this->writer().get_position().z()}; + file.write(this->writer().get_travel_to_z_gcode(last_z, "ensure z position")); file.write(this->travel_to(*this->last_position, Point(0, 0), ExtrusionRole::None, "move to origin position for next object", "")); m_enable_cooling_markers = true; // Disable motion planner when traveling to first object point. diff --git a/tests/fff_print/test_gcode.cpp b/tests/fff_print/test_gcode.cpp index a87e6dc317..fc693b29d4 100644 --- a/tests/fff_print/test_gcode.cpp +++ b/tests/fff_print/test_gcode.cpp @@ -149,7 +149,7 @@ TEST_CASE("Extrusion, travels, temeperatures", "[GCode]") { INFO("Unexpected E argument"); CHECK(!line.has_e()); - if (line.has_z()) { + if (line.has_z() && std::abs(line.dist_Z(self)) > 0) { z_moves.emplace_back(line.z()); } if (line.has_x() || line.has_y()) {