From 849e6493f81a2961a4ed5588d1ce94f3d7760418 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Thu, 6 Aug 2026 03:54:19 -0500 Subject: [PATCH] Belt brim: offer "Leading edge only" only on belt printers "Leading edge only" describes where a part meets a moving belt, so it has no meaning on a fixed bed and should not clutter the Brim type dropdown there. Filtered the same way support_style and wipe_tower_wall_type already are a few lines above in TabPrint::toggle_options(): the field holds its own copy of the option definition, and Choice maps the combobox selection straight onto that copy's enum_values, so rewriting the values, the labels and the combobox items together keeps the mapping correct. The entry is kept when it is the current value, so opening a project that uses it on a non-belt printer cannot leave the control displaying an option it does not offer - which would silently rewrite the setting on the next edit. Print::validate() already warns that it prints as an ordinary outer brim there. Matches the scope of the existing precedents: the per-object override panel is not filtered. --- src/slic3r/GUI/Tab.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 7a4cefe4fa..5508b6e099 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -3227,6 +3227,41 @@ void TabPrint::toggle_options() cb->SetValue(n); } + // "Leading edge only" describes where a part meets a moving belt, so it is offered only + // on belt printers. Same pattern as support_style above: the field owns a copy of the + // option definition, and Choice maps the combobox selection straight onto that copy's + // enum_values, so rewriting both together keeps the mapping correct. + field = m_active_page->get_field("brim_type"); + if (auto choice = dynamic_cast(field)) { + bool is_belt_printer = false; + if (m_preset_bundle) { + const auto *belt_opt = m_preset_bundle->printers.get_edited_preset().config.option("belt_printer"); + if (belt_opt) + is_belt_printer = belt_opt->value; + } + auto def = print_config_def.get("brim_type"); + const auto current = m_config->opt_enum("brim_type"); + auto &opt = const_cast(field->m_opt); + auto cb = dynamic_cast(choice->window); + if (cb != nullptr) { + auto n = cb->GetValue(); + opt.enum_values.clear(); + opt.enum_labels.clear(); + cb->Clear(); + for (size_t i = 0; i < def->enum_values.size(); ++ i) { + // Keep the entry if it is already selected, so switching to a non-belt + // printer cannot leave the control showing a value it does not offer. + if (def->enum_values[i] == "leading_edge_only" && ! is_belt_printer + && current != btLeadingEdgeOnly) + continue; + opt.enum_values.push_back(def->enum_values[i]); + opt.enum_labels.push_back(def->enum_labels[i]); + cb->Append(_(def->enum_labels[i])); + } + cb->SetValue(n); + } + } + // BBL printers do not support cone wipe tower field = m_active_page->get_field("wipe_tower_wall_type"); if (auto choice = dynamic_cast(field)) {