Hide mixed slots from the support and wipe tower filament dropdowns

This commit is contained in:
SoftFever
2026-08-23 22:11:49 +08:00
parent 716bba53df
commit cfeca9b9ff
2 changed files with 44 additions and 17 deletions
+8 -7
View File
@@ -578,12 +578,13 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
// BBS
// A filament override naming a slot that no longer exists is stale and falls back to the
// plater's value. Support is additionally restricted to physical filaments: the support paths
// (ToolOrdering::collect_extruders, Print::validate) consume support_filament directly, with
// no per-layer mixed resolution, so a virtual slot there would reach the G-code unresolved.
// The per-feature keys have no such restriction — LayerTools::extruder() and its siblings
// resolve a mixed slot to the physical filament chosen for each layer.
static const char* support_keys[] = { "support_filament", "support_interface_filament" };
// plater's value. Support and the wipe tower are additionally restricted to physical filaments:
// the engine consumes those keys directly, with no per-layer mixed resolution, so a virtual
// slot there would reach the G-code unresolved. The per-feature keys have no such restriction —
// LayerTools::extruder() and its siblings resolve a mixed slot to the physical filament chosen
// for each layer. The sidebar dropdowns already hide mixed slots for the restricted keys
// (Plater.cpp DynamicFilamentList); this reset covers values loaded from projects.
static const char* physical_only_keys[] = { "support_filament", "support_interface_filament", "wipe_tower_filament" };
static const char* feature_keys[] = { "outer_wall_filament_id", "inner_wall_filament_id",
"sparse_infill_filament_id", "internal_solid_filament_id",
"top_surface_filament_id", "bottom_surface_filament_id" };
@@ -607,7 +608,7 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
new_conf.set_key_value(key, new ConfigOptionInt(new_value));
apply(config, &new_conf);
};
for (const char* key : support_keys)
for (const char* key : physical_only_keys)
reset_invalid_filament(key, false);
for (const char* key : feature_keys)
reset_invalid_filament(key, true);