From b871e9318fdfe611e1678ebe5b8090ee9667e4f7 Mon Sep 17 00:00:00 2001 From: "zhimin.zeng" Date: Tue, 26 Nov 2024 10:47:36 +0800 Subject: [PATCH] FIX: the nums of nozzle_volume_type is incorrect when save MW 3mf file as multi-extruder jira:none Change-Id: I848e348277fb047c2c3569508d2adbe940e40255 (cherry picked from commit 17edbd8cd57b761027bb3c1f4d318578ab27430e) --- src/libslic3r/PresetBundle.cpp | 6 ++++++ src/libslic3r/PresetBundle.hpp | 2 ++ src/slic3r/GUI/Tab.cpp | 1 + 3 files changed, 9 insertions(+) diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp index 4a8e0b95a2..12b1164b4f 100644 --- a/src/libslic3r/PresetBundle.cpp +++ b/src/libslic3r/PresetBundle.cpp @@ -2175,6 +2175,12 @@ bool PresetBundle::is_the_only_edited_filament(unsigned int filament_index) return true; } +void PresetBundle::reset_default_nozzle_volume_type() +{ + Preset& current_printer = this->printers.get_edited_preset(); + this->project_config.option("nozzle_volume_type")->values = current_printer.config.option("default_nozzle_volume_type")->values; +} + int PresetBundle::get_printer_extruder_count() const { const Preset& printer_preset = this->printers.get_edited_preset(); diff --git a/src/libslic3r/PresetBundle.hpp b/src/libslic3r/PresetBundle.hpp index 14d804988c..e36bace897 100644 --- a/src/libslic3r/PresetBundle.hpp +++ b/src/libslic3r/PresetBundle.hpp @@ -120,6 +120,8 @@ public: //BBS: check whether this is the only edited filament bool is_the_only_edited_filament(unsigned int filament_index); + void reset_default_nozzle_volume_type(); + std::vector get_used_tpu_filaments(const std::vector &used_filaments); // Orca: update selected filament and print void update_selections(AppConfig &config); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index e9d45fb82b..ec48ee4063 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4277,6 +4277,7 @@ void TabPrinter::extruders_count_changed(size_t extruders_count) m_extruders_count = extruders_count; m_preset_bundle->printers.get_edited_preset().set_num_extruders(extruders_count); m_preset_bundle->update_multi_material_filament_presets(); + m_preset_bundle->reset_default_nozzle_volume_type(); is_count_changed = true; wxGetApp().plater()->get_partplate_list().on_extruder_count_changed((int)m_extruders_count);