From f832fb2d4dbae756fed888b9577e9dd7c80fbca0 Mon Sep 17 00:00:00 2001 From: viewit Date: Tue, 2 Jun 2026 22:07:50 +0200 Subject: [PATCH] fix(preset): filament_id auch generieren wenn sie vom Parent geerbt wurde (== base_id) --- src/libslic3r/Preset.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 6e600096db..89b12e625f 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -642,8 +642,12 @@ void Preset::save(DynamicPrintConfig* parent_config) // Generate a unique filament_id for user filament presets that don't have one yet. // Inherited presets (e.g. "My PLA" inheriting "Generic PLA @System") previously had // no filament_id which caused AMS sync to fall back to the parent's Generic ID. - if (this->is_user() && this->filament_id.empty() && !this->name.empty() && - this->type == Preset::TYPE_FILAMENT) { + // Also generate a new ID if filament_id is inherited from the parent (== base_id). + // This happens when a user preset is saved for the first time without having its own ID. + bool needs_unique_filament_id = this->is_user() && !this->name.empty() && + this->type == Preset::TYPE_FILAMENT && + (this->filament_id.empty() || (!this->base_id.empty() && this->filament_id == this->base_id)); + if (needs_unique_filament_id) { boost::uuids::detail::md5 hash; boost::uuids::detail::md5::digest_type digest; hash.process_bytes(this->name.data(), this->name.size());