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());