Refresh the mixed filament list when a component preset changes

This commit is contained in:
SoftFever
2026-08-23 13:59:59 +08:00
parent af5397d678
commit 38d51783ae
2 changed files with 35 additions and 1 deletions

View File

@@ -7318,7 +7318,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
"brim_width", "brim_object_gap", "brim_flow_ratio", "brim_use_efc_outline", "combine_brims", "brim_type", "nozzle_diameter", "single_extruder_multi_material", "preferred_orientation",
"enable_prime_tower", "wipe_tower_x", "wipe_tower_y", "prime_tower_width", "prime_tower_brim_width", "prime_tower_skip_points", "prime_tower_enable_framework",
"prime_tower_infill_gap", "prime_volume",
"extruder_colour", "filament_colour", "filament_type", "material_colour", "printable_height", "extruder_printable_height", "printer_model", "printer_technology",
"extruder_colour", "filament_colour", "filament_type", "filament_is_support", "material_colour", "printable_height", "extruder_printable_height", "printer_model", "printer_technology",
// These values are necessary to construct SlicingParameters by the Canvas3D variable layer height editor.
"layer_height", "initial_layer_print_height", "min_layer_height", "max_layer_height",
"wall_loops", "outer_wall_filament_id", "inner_wall_filament_id", "sparse_infill_density", "sparse_infill_filament_id", "top_shell_layers",
@@ -19661,6 +19661,7 @@ void Plater::on_config_change(const DynamicPrintConfig &config)
update_scheduled = true; // update should be scheduled (for update 3DScene) #2738
if (update_filament_colors_in_full_config()) {
p->sidebar->update_mixed_filament_list();
p->sidebar->obj_list()->update_filament_colors();
p->sidebar->update_dynamic_filament_list();
continue;
@@ -19668,6 +19669,15 @@ void Plater::on_config_change(const DynamicPrintConfig &config)
}
if (opt_key == "filament_type") {
update_filament_colors_in_full_config();
p->sidebar->update_mixed_filament_list();
continue;
}
// The mixed-filament type check folds filament_is_support into the component type
// (DynamicPrintConfig::get_filament_type -> "PLA-S"), so a support-preset switch must
// refresh the list even though filament_type itself did not change.
if (opt_key == "filament_is_support") {
p->config->set_key_value(opt_key, config.option(opt_key)->clone());
p->sidebar->update_mixed_filament_list();
continue;
}
if (opt_key == "material_colour") {