Warn about mixed color sublayer when adding height ranges

This commit is contained in:
SoftFever
2026-08-23 14:13:33 +08:00
parent 38d51783ae
commit f02423074c
2 changed files with 20 additions and 2 deletions

View File

@@ -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() ?

View File

@@ -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")) {