diff --git a/src/slic3r/GUI/DoubleSliderForLayers.cpp b/src/slic3r/GUI/DoubleSliderForLayers.cpp index 4a56eea221..158629be0c 100644 --- a/src/slic3r/GUI/DoubleSliderForLayers.cpp +++ b/src/slic3r/GUI/DoubleSliderForLayers.cpp @@ -1248,6 +1248,9 @@ std::string DSForLayers::get_tooltip(int tick/*=-1*/) else if (conflict == ctMeaninglessToolChange) tooltip += _u8L("There is an extruder change set to the same extruder.\n" "This code won't be processed during G-code generation."); + else if (conflict == ctNotPossibleToolChange) + tooltip += _u8L("There is an extruder change set to the not existing extruder.\n" + "This code won't be processed during G-code generation."); else if (conflict == ctRedundant) tooltip += _u8L("There is a color change for extruder that has not been used before.\n" "Check your settings to avoid redundant color changes."); diff --git a/src/slic3r/GUI/TickCodesManager.cpp b/src/slic3r/GUI/TickCodesManager.cpp index b11a409547..d1b681c42a 100644 --- a/src/slic3r/GUI/TickCodesManager.cpp +++ b/src/slic3r/GUI/TickCodesManager.cpp @@ -659,6 +659,9 @@ ConflictType TickCodeManager::is_conflict_tick(const TickCode& tick, Mode main_m // We should mark a tick as a "MeaninglessToolChange", // if it has a ToolChange to the same extruder auto it = ticks.find(tick); + if (it->extruder > colors.size()) + return ctNotPossibleToolChange; + if (it == ticks.begin()) return tick.extruder == std::max(only_extruder_id, 1) ? ctMeaninglessToolChange : ctNone; @@ -676,6 +679,9 @@ std::string TickCodeManager::get_color_for_tool_change_tick(std::set:: { const int current_extruder = it->extruder == 0 ? std::max(only_extruder_id, 1) : it->extruder; + if (current_extruder > colors.size()) + return it->color; + auto it_n = it; while (it_n != ticks.begin()) { --it_n; diff --git a/src/slic3r/GUI/TickCodesManager.hpp b/src/slic3r/GUI/TickCodesManager.hpp index c736545a22..bf440b696a 100644 --- a/src/slic3r/GUI/TickCodesManager.hpp +++ b/src/slic3r/GUI/TickCodesManager.hpp @@ -37,6 +37,7 @@ enum ConflictType ctModeConflict, ctMeaninglessColorChange, ctMeaninglessToolChange, + ctNotPossibleToolChange, ctRedundant };