From 6303d0a59a261558fd7d172239ff257a9f335449 Mon Sep 17 00:00:00 2001 From: Joseph Lenox Date: Sun, 2 Sep 2018 11:49:08 -0500 Subject: [PATCH] Fixed regression where end gcode wasn't being applied in CLI path. --- xs/src/libslic3r/PrintGCode.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xs/src/libslic3r/PrintGCode.cpp b/xs/src/libslic3r/PrintGCode.cpp index 82cb85c90..179943679 100644 --- a/xs/src/libslic3r/PrintGCode.cpp +++ b/xs/src/libslic3r/PrintGCode.cpp @@ -128,7 +128,7 @@ PrintGCode::output() if (include_start_extruder_temp) this->_print_first_layer_temperature(0); - // Apply gcode math to start and end gcode + // Apply gcode math to start gcode fh << apply_math(gcodegen.placeholder_parser->process(config.start_gcode.value)); for(const auto& start_gcode : config.start_filament_gcode.values) { @@ -276,6 +276,11 @@ PrintGCode::output() // Write end commands to file. fh << gcodegen.retract(); // TODO: process this retract through PressureRegulator in order to discharge fully + for(const auto& end_gcode : config.end_filament_gcode.values) { + fh << apply_math(gcodegen.placeholder_parser->process(end_gcode)); + } + + fh << apply_math(gcodegen.placeholder_parser->process(config.end_gcode)); // set bed temperature if (config.has_heatbed && temp > 0 && std::regex_search(config.end_gcode.getString(), bed_temp_regex)) {