diff --git a/lib/Slic3r/Print/GCode.pm b/lib/Slic3r/Print/GCode.pm index bc0cd9df4..a54c19f8f 100644 --- a/lib/Slic3r/Print/GCode.pm +++ b/lib/Slic3r/Print/GCode.pm @@ -142,6 +142,9 @@ sub export { # disable fan print $fh $gcodegen->writer->set_fan(0, 1) if $self->config->cooling && $self->config->disable_fan_first_layers; + + # set initial extruder so it can be used in start G-code + print $fh $gcodegen->set_extruder($self->print->extruders->[0]); # set bed temperature if ($self->config->has_heatbed && (my $temp = $self->config->first_layer_bed_temperature) && $self->config->start_gcode !~ /M(?:190|140)/i) { @@ -223,9 +226,6 @@ sub export { } } - # set initial extruder only after custom start G-code - print $fh $gcodegen->set_extruder($self->print->extruders->[0]); - # do all objects for each layer if ($self->config->complete_objects) { # print objects from the smallest to the tallest to avoid collisions diff --git a/xs/src/libslic3r/PrintGCode.cpp b/xs/src/libslic3r/PrintGCode.cpp index 17dc1aa17..83200bd9c 100644 --- a/xs/src/libslic3r/PrintGCode.cpp +++ b/xs/src/libslic3r/PrintGCode.cpp @@ -102,6 +102,7 @@ PrintGCode::output() fh << _gcodegen.writer.set_fan(0,1) << "\n"; } + // set initial extruder so it can be used in start G-code const auto extruders = _print.extruders(); fh << _gcodegen.set_extruder( *(extruders.begin()) );