From 44dc572bf70eb337f027c469fda01526bf8241e0 Mon Sep 17 00:00:00 2001 From: Joseph Lenox Date: Tue, 24 Apr 2018 19:00:25 -0500 Subject: [PATCH] Use heatbed config option to determine whether to auto-include M140 S0 at end. --- lib/Slic3r/Print/GCode.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/Print/GCode.pm b/lib/Slic3r/Print/GCode.pm index 39eeafa9f..c98880496 100644 --- a/lib/Slic3r/Print/GCode.pm +++ b/lib/Slic3r/Print/GCode.pm @@ -308,8 +308,10 @@ sub export { $self->_print_off_temperature(0) if $include_end_extruder_temp; - print $fh $self->_gcodegen->writer->set_bed_temperature(0, 0) - if $include_end_extruder_temp; + # set bed temperature + if ($self->config->has_heatbed && $self->config->start_gcode !~ /M(?:190|140)/i) { + printf $fh $gcodegen->writer->set_bed_temperature(0, 0); + } print $fh $gcodegen->writer->update_progress($gcodegen->layer_count, $gcodegen->layer_count, 1); # 100% print $fh $gcodegen->writer->postamble;