toolchange_gcode now erase the built-in change gcode if set.

supermerill/SuperSlicer#1195
This commit is contained in:
remi durand 2021-05-28 14:38:43 +02:00
parent b9b7c77c85
commit dfc2689cb3
2 changed files with 3 additions and 2 deletions

View File

@ -328,7 +328,7 @@ static inline void set_extra_lift(const Layer& layer, const Print& print, GCodeW
std::string toolchange_command;
if (tcr.priming || (new_extruder_id >= 0 && gcodegen.writer().need_toolchange(new_extruder_id)))
toolchange_command = gcodegen.writer().toolchange(new_extruder_id);
if (!custom_gcode_changes_tool(toolchange_gcode_str, gcodegen.writer().toolchange_prefix(), new_extruder_id))
if (toolchange_gcode.empty()) //!custom_gcode_changes_tool(toolchange_gcode_str, gcodegen.writer().toolchange_prefix(), new_extruder_id))
toolchange_gcode_str += toolchange_command;
else {
// We have informed the m_writer about the current extruder_id, we can ignore the generated G-code.

View File

@ -3955,7 +3955,8 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("This custom code is inserted at every extruder change. If you don't leave this empty, you are "
"expected to take care of the toolchange yourself - slic3r will not output any other G-code to "
"change the filament. You can use placeholder variables for all Slic3r settings as well as [previous_extruder] "
"and [next_extruder], so e.g. the standard toolchange command can be scripted as T[next_extruder].");
"and [next_extruder], so e.g. the standard toolchange command can be scripted as T[next_extruder]."
"!! Warning !!: if any charater is written here, slic3r won't output any toochange command by itself.");
def->multiline = true;
def->full_width = true;
def->height = 5;