Follow-up 9bb74d92c7 - Suppress to suggest of the "Automatic color change", if some color changes are already apply for the model

This commit is contained in:
YuSanka 2022-09-02 15:22:24 +02:00
parent 39788066e2
commit 1d145bb359

View file

@ -705,8 +705,17 @@ void Preview::update_layers_slider(const std::vector<double>& layers_z, bool kee
m_layers_slider->SetLayersTimes(print_mode_stat.layers_times, print_mode_stat.time);
}
// check if ticks_info_from_model contains ColorChange g-code
bool color_change_already_exists = false;
for (const CustomGCode::Item& gcode: ticks_info_from_model.gcodes)
if (gcode.type == CustomGCode::Type::ColorChange) {
color_change_already_exists = true;
break;
}
// Suggest the auto color change, if model looks like sign
if (wxGetApp().app_config->get("allow_auto_color_change") == "1" &&
if (!color_change_already_exists &&
wxGetApp().app_config->get("allow_auto_color_change") == "1" &&
m_layers_slider->IsNewPrint())
{
const Print& print = wxGetApp().plater()->fff_print();