diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index 270de27a2c..a5e1c6abf1 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -506,9 +506,20 @@ std::string GCodeWriter::update_progress(unsigned int num, unsigned int tot, boo std::string GCodeWriter::toolchange_prefix() const { - return config.manual_filament_change ? ";" + GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Manual_Tool_Change) + "T": - FLAVOR_IS(gcfMakerWare) ? "M135 T" : - FLAVOR_IS(gcfSailfish) ? "M108 T" : "T"; + std::string gcode = "T"; + if (config.manual_filament_change) + gcode = ";" + GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Manual_Tool_Change) + "T"; + else { + if (m_is_bbl_printers) + gcode = "M1020 S"; + else { + if (FLAVOR_IS(gcfMakerWare)) + gcode = "M135 T"; + else if (FLAVOR_IS(gcfSailfish)) + gcode = "M108 T"; + } + } + return gcode; } std::string GCodeWriter::toolchange(unsigned int filament_id) @@ -523,12 +534,8 @@ std::string GCodeWriter::toolchange(unsigned int filament_id) // if we are running a single-extruder setup, just set the extruder and return nothing std::ostringstream gcode; if (this->multiple_extruders || (this->config.filament_diameter.values.size() > 1 && !is_bbl_printers())) { - // BBS - if (this->m_is_bbl_printers) - gcode << "M1020 S" << filament_id; - else - gcode << this->toolchange_prefix() << filament_id; - //BBS + // Orca: call toolchange_prefix() to get the correct command prefix based on the configuration and flavor. + gcode << this->toolchange_prefix() << filament_id; if (GCodeWriter::full_gcode_comment) gcode << " ; change extruder"; gcode << "\n";