From 6d0ec7903180b195216b80c442d355442d536865 Mon Sep 17 00:00:00 2001 From: QIDI TECH <893239786@qq.com> Date: Sat, 24 May 2025 10:17:38 +0800 Subject: [PATCH] fix some bug --- src/libslic3r/Preset.cpp | 15 +++++++-------- src/slic3r/GUI/Plater.cpp | 4 +++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 623db6e..f6655fd 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -2605,14 +2605,13 @@ const Preset* PresetCollection::get_preset_parent(const Preset& child) const const Preset *PresetCollection::get_preset_base(const Preset &child) const { //y60 - //if (child.is_system || child.is_default) - // return &child; - //// Handle user preset - //if (child.inherits().empty()) - // return &child; // this is user root - //auto inherits = find_preset(child.inherits()); - //return inherits ? get_preset_base(*inherits) : nullptr; - return &child; + if (child.is_system || child.is_default) + return &child; + // Handle user preset + if (child.inherits().empty()) + return &child; // this is user root + auto inherits = find_preset(child.inherits()); + return inherits ? get_preset_base(*inherits) : nullptr; } // Return vendor of the first parent profile, for which the vendor is defined, or null if such profile does not exist. diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index a1e6e95..250a6fd 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2565,7 +2565,9 @@ bool Sidebar::reset_bed_type_combox_choices() { const VendorProfile::PrinterModel *pm = PresetUtils::system_printer_model(*curr); if (!pm) { auto curr_parent = bundle->printers.get_selected_preset_parent(); - pm = PresetUtils::system_printer_model(*curr_parent); + //y62 + if(curr_parent) + pm = PresetUtils::system_printer_model(*curr_parent); } //y58 //if (m_last_combo_bedtype_count != 0 && pm) {