From 73c70021df2ee2f37ed538660552e9505500c149 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Thu, 17 Jan 2013 15:02:40 +0100 Subject: [PATCH] Change toolchange and G92 E0 order for makerbot and sailfish G-code flavors. #855 --- lib/Slic3r/GCode.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/GCode.pm b/lib/Slic3r/GCode.pm index b60025df3..bad4db918 100644 --- a/lib/Slic3r/GCode.pm +++ b/lib/Slic3r/GCode.pm @@ -468,11 +468,18 @@ sub set_extruder { # set the new extruder $self->extruder($extruder); - $gcode .= sprintf "%s%d%s\n", + my $toolchange_gcode = sprintf "%s%d%s\n", ($Slic3r::Config->gcode_flavor =~ /^(?:makerbot|sailfish)$/ ? 'M108 T' : 'T'), $extruder->id, ($Slic3r::Config->gcode_comments ? ' ; change extruder' : ''); - $gcode .= $self->reset_e; + + if ($Slic3r::Config->gcode_flavor =~ /^(?:makerbot|sailfish)$/) { + $gcode .= $self->reset_e; + $gcode .= $toolchange_gcode; + } else { + $gcode .= $toolchange_gcode; + $gcode .= $self->reset_e; + } return $gcode; }