diff --git a/include/pathPlanning/GCodePath.h b/include/pathPlanning/GCodePath.h index 09160202d9..577cd8efcc 100644 --- a/include/pathPlanning/GCodePath.h +++ b/include/pathPlanning/GCodePath.h @@ -40,6 +40,7 @@ struct GCodePath Ratio speed_factor{ 1.0 }; //!< A speed factor that is multiplied with the travel speed. This factor can be used to change the travel speed. Ratio speed_back_pressure_factor{ 1.0 }; // retraction_wipe_config : retraction_config; gcode.writeRetraction(retraction_config->retraction_config); + if (path.retract_for_nozzle_switch) + { + constexpr bool force = true; + constexpr bool extruder_switch = true; + gcode.writeRetraction(retraction_config->extruder_switch_retraction_config, force, extruder_switch); + } insertTempOnTime(extruder_plan.getRetractTime(path), path_idx); if (path.perform_z_hop) { diff --git a/src/plugins/converters.cpp b/src/plugins/converters.cpp index f53d2cbc7c..964a50007d 100644 --- a/src/plugins/converters.cpp +++ b/src/plugins/converters.cpp @@ -347,6 +347,7 @@ gcode_paths_modify_request::value_type gcode_path->set_speed_factor(path.speed_factor); gcode_path->set_speed_back_pressure_factor(path.speed_back_pressure_factor); gcode_path->set_retract(path.retract); + gcode_path->set_retract_for_nozzle_switch(path.retract_for_nozzle_switch); gcode_path->set_unretract_before_last_travel_move(path.unretract_before_last_travel_move); gcode_path->set_perform_z_hop(path.perform_z_hop); gcode_path->set_perform_prime(path.perform_prime); @@ -464,6 +465,7 @@ gcode_paths_modify_response::native_value_type .speed_factor = gcode_path_msg.speed_factor(), .speed_back_pressure_factor = gcode_path_msg.speed_back_pressure_factor(), .retract = gcode_path_msg.retract(), + .retract_for_nozzle_switch = gcode_path_msg.retract_for_nozzle_switch(), .unretract_before_last_travel_move = gcode_path_msg.unretract_before_last_travel_move(), .perform_z_hop = gcode_path_msg.perform_z_hop(), .perform_prime = gcode_path_msg.perform_prime(),