diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 6c0a770069..f306100afd 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -2844,7 +2844,7 @@ void GCodeProcessor::register_commands() {"G3", [this](const GCodeReader::GCodeLine& line) { process_G2_G3(line, false); }}, // Move {"G4", [this](const GCodeReader::GCodeLine& line) { process_G4(line); }}, // Delay - {"G10", [this](const GCodeReader::GCodeLine& line) { process_G10(line); }}, // Retract + {"G10", [this](const GCodeReader::GCodeLine& line) { process_G10(line); }}, // Retract, or set tool temperature on RepRapFirmware {"G11", [this](const GCodeReader::GCodeLine& line) { process_G11(line); }}, // Unretract {"G20", [this](const GCodeReader::GCodeLine& line) { process_G20(line); }}, // Set Units to Inches @@ -6405,6 +6405,20 @@ void GCodeProcessor::process_G29(const GCodeReader::GCodeLine& line) void GCodeProcessor::process_G10(const GCodeReader::GCodeLine& line) { + // Orca: RepRapFirmware's G10 with parameters sets tool temperatures, offsets or workplaces, only a bare G10 retracts + if (m_flavor == gcfRepRapFirmware && + (line.has('P') || line.has('R') || line.has('S') || line.has('L') || line.has_x() || line.has_y() || line.has_z())) { + float new_temp; + if (line.has_value('S', new_temp)) { + float tool; + const int filament_id = line.has_value('P', tool) ? static_cast(tool) : get_filament_id(); + // Orca: RRF turns a heater off with a negative temperature + if (filament_id >= 0 && filament_id < static_cast(m_extruder_temps.size())) + m_extruder_temps[filament_id] = std::max(new_temp, 0.f); + } + return; + } + // Emulate G1 retract, decrement G1 count as it's will be incremented in process_G1, but it's fake G1 GCodeReader::GCodeLine g10; g10.set(Axis::E, -this->m_parser.config().retraction_length.get_at(m_extruder_id));