From f02423074c2f6ac0f0ed0cce7f188e4fb242abe7 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Sun, 23 Aug 2026 14:13:33 +0800 Subject: [PATCH] Warn about mixed color sublayer when adding height ranges --- src/slic3r/GUI/GUI_ObjectList.cpp | 18 ++++++++++++++++++ src/slic3r/GUI/Plater.cpp | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index dc89f5f9bb..48182da77b 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -3233,6 +3233,24 @@ void ObjectList::merge(bool to_multipart_object) void ObjectList::layers_editing() { + // Height ranges give each range its own layer height, varying the mixed sub-layer heights just + // like an adaptive profile; sibling of the on_action_layersediting/ConfigManipulation warnings, + // sharing the same do-not-show-again flag. + const auto& print_config = wxGetApp().preset_bundle->prints.get_edited_preset().config; + if (print_config.opt_bool("enable_mixed_color_sublayer")) { + if (wxGetApp().app_config->get("no_warn_mixed_sublayer_variable_layer") != "1") { + // Orca: parent to the plater like the sibling site in Plater::priv::on_action_layersediting + // (BBS passes nullptr, which MsgDialog remaps to the main frame). + MessageDialog dlg(wxGetApp().plater(), + _L("Using variable layer height together with mixed color sublayer may result in poor color mixing quality."), + _L("Warning"), wxICON_WARNING | wxOK); + dlg.show_dsa_button(); + dlg.ShowModal(); + if (dlg.get_checkbox_state()) + wxGetApp().app_config->set("no_warn_mixed_sublayer_variable_layer", "1"); + } + } + const Selection& selection = scene_selection(); const int obj_idx = selection.get_object_idx(); wxDataViewItem item = obj_idx >= 0 && GetSelectedItemsCount() > 1 && selection.is_single_full_object() ? diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 40cffd2641..7ff7b193df 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -14077,8 +14077,8 @@ void Plater::priv::on_action_layersediting(SimpleEvent&) // Sub-layer splitting divides each layer by the mix ratio, so an adaptive layer profile makes // those sub-layer heights vary and degrades the blend. ConfigManipulation warns when the // option is switched on with a variable profile already present; this is the other direction, - // warning when variable layer editing is switched on while the option is active. Both honour - // the same do-not-show-again flag. + // warning when variable layer editing is switched on while the option is active. All three + // sites (with ObjectList::layers_editing for height ranges) honour the same do-not-show-again flag. if (!view3D->is_layers_editing_enabled()) { const auto& print_config = wxGetApp().preset_bundle->prints.get_edited_preset().config; if (print_config.opt_bool("enable_mixed_color_sublayer")) {