diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 906b4c76b6..376529a14e 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -474,7 +474,7 @@ static std::vector s_Preset_filament_options { "overhang_fan_speed_0", "overhang_fan_speed_1", "overhang_fan_speed_2", "overhang_fan_speed_3", // Retract overrides "filament_retract_length", "filament_retract_lift", "filament_retract_lift_above", "filament_retract_lift_below", "filament_retract_speed", "filament_deretract_speed", "filament_retract_restart_extra", "filament_retract_before_travel", - "filament_retract_layer_change", "filament_wipe", "filament_retract_before_wipe", + "filament_retract_layer_change", "filament_wipe", "filament_retract_before_wipe", "filament_retract_length_toolchange", "filament_retract_restart_extra_toolchange", // Profile compatibility "filament_vendor", "compatible_prints", "compatible_prints_condition", "compatible_printers", "compatible_printers_condition", "inherits" }; diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 4b17e2c3d5..83dd450c23 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -3376,7 +3376,8 @@ void PrintConfigDef::init_fff_params() // Declare retract values for filament profile, overriding the printer's extruder profile. for (const char *opt_key : { // floats - "retract_length", "retract_lift", "retract_lift_above", "retract_lift_below", "retract_speed", "deretract_speed", "retract_restart_extra", "retract_before_travel", + "retract_length", "retract_lift", "retract_lift_above", "retract_lift_below", "retract_speed", + "deretract_speed", "retract_restart_extra", "retract_before_travel", "retract_length_toolchange", "retract_restart_extra_toolchange", // bools "retract_layer_change", "wipe", // percents @@ -3415,10 +3416,12 @@ void PrintConfigDef::init_extruder_option_keys() "retract_before_wipe", "retract_layer_change", "retract_length", + "retract_length_toolchange", "retract_lift", "retract_lift_above", "retract_lift_below", "retract_restart_extra", + "retract_restart_extra_toolchange", "retract_speed", "wipe" }; diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 0fd5e75ad1..f3dc02e46f 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1903,6 +1903,13 @@ void TabFilament::add_filament_overrides_page() "filament_retract_before_wipe" }) create_line_with_near_label_widget(optgroup, opt_key, extruder_idx); + + optgroup = page->new_optgroup(L("Retraction when tool is disabled")); + for (const std::string opt_key : { "filament_retract_length_toolchange", + "filament_retract_restart_extra_toolchange" + }) + create_line_with_near_label_widget(optgroup, opt_key, extruder_idx); + } void TabFilament::update_filament_overrides_page() @@ -1911,7 +1918,7 @@ void TabFilament::update_filament_overrides_page() return; Page* page = m_active_page; - const auto og_it = std::find_if(page->m_optgroups.begin(), page->m_optgroups.end(), [](const ConfigOptionsGroupShp og) { return og->title == "Retraction"; }); + auto og_it = std::find_if(page->m_optgroups.begin(), page->m_optgroups.end(), [](const ConfigOptionsGroupShp og) { return og->title == "Retraction"; }); if (og_it == page->m_optgroups.end()) return; ConfigOptionsGroupShp optgroup = *og_it; @@ -1939,6 +1946,16 @@ void TabFilament::update_filament_overrides_page() bool is_checked = opt_key=="filament_retract_length" ? true : have_retract_length; update_line_with_near_label_widget(optgroup, opt_key, extruder_idx, is_checked); } + + og_it = std::find_if(page->m_optgroups.begin(), page->m_optgroups.end(), [](const ConfigOptionsGroupShp og) { return og->title == "Retraction when tool is disabled"; }); + if (og_it == page->m_optgroups.end()) + return; + optgroup = *og_it; + + for (const std::string& opt_key : {"filament_retract_length_toolchange", "filament_retract_restart_extra_toolchange"}) + update_line_with_near_label_widget(optgroup, opt_key, extruder_idx); + + } void TabFilament::create_extruder_combobox()