Fix multi-tool printer filament UI issue (#11957)

This commit is contained in:
SoftFever 2026-01-15 11:09:28 +08:00 committed by GitHub
parent 8225d642d0
commit 9b8f3e2662
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6835,7 +6835,16 @@ void GUI_App::load_current_presets(bool active_preset_combox/*= false*/, bool ch
if (check_printer_presets_)
check_printer_presets();
PrinterTechnology printer_technology = preset_bundle->printers.get_edited_preset().printer_technology();
auto& edited_printer_preset = preset_bundle->printers.get_edited_preset();
PrinterTechnology printer_technology = edited_printer_preset.printer_technology();
// ORCA: Sync filament count with the printer's nozzle count before loading presets for multi-tool printers.
// This ensures filament_presets vector is properly sized when combo boxes are created/updated.
if (printer_technology == ptFFF && !edited_printer_preset.config.opt_bool("single_extruder_multi_material")) {
auto* nozzle_diameter = edited_printer_preset.config.option<ConfigOptionFloats>("nozzle_diameter");
if (nozzle_diameter) {
preset_bundle->set_num_filaments(nozzle_diameter->values.size());
}
}
this->plater()->set_printer_technology(printer_technology);
for (Tab *tab : tabs_list)
if (tab->supports_printer_technology(printer_technology)) {