From 135a57137963a1f44d04bf8126deeb3815f7168f Mon Sep 17 00:00:00 2001 From: Clifford Garwood Date: Wed, 22 Apr 2026 01:20:29 -0400 Subject: [PATCH] fix(preset): don't truncate child variant vectors to parent size on load update_non_diff_values_to_base_config sizes variant_index to the parent's (inherits-target's) extruder count, and set_with_restore then replaces the child's vector with a parent-sized one. When the child preset has more extruders than the parent (e.g. an IDEX preset inheriting from a single-nozzle base), every key in printer_options_with_variant_1 is truncated to the parent's size on project reload, destroying per-extruder data. Observable symptoms: objects render with the wrong color (often black) after reopening the project, and the printer preset shows a permanent dirty-asterisk that no save/reload cycle can clear. The child's saved value is authoritative for its own extruder count, so skip the parent-shaped merge for the variant-keyed branch when cur > target. Confirmed by loading a 2-extruder IDEX preset inheriting from a single-nozzle base: all 24 variant-keyed options previously truncated from child_size=2 -> 1 are now preserved at size 2. Co-Authored-By: Claude Opus 4.7 --- src/libslic3r/PrintConfig.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index c75b70b9d1..5f5bb5e66f 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -9546,6 +9546,13 @@ void DynamicPrintConfig::update_non_diff_values_to_base_config(DynamicPrintConfi //nothing to do, keep the original one } else { + // Guard: set_with_restore is parent-shaped and would truncate the child's + // vector when the child has more extruders than the parent (e.g. an IDEX + // preset inheriting from a single-nozzle base). The child's saved value is + // authoritative for its own extruder count, so skip the merge for this key. + if (cur_variant_count > target_variant_count) + continue; + int stride = 1; if (key_set2.find(opt) != key_set2.end()) stride = 2;