Scope plugin config overrides per preset type

Replace the shared plugin_config_overrides key with print/printer/filament
scoped keys so merging presets into one full config cannot clobber an edited
override, letting a slicing plugin config change invalidate the slice step.
This commit is contained in:
SoftFever
2026-07-25 15:28:14 +08:00
parent b5430b53e7
commit 6e1a6cc678
15 changed files with 138 additions and 106 deletions
+12 -3
View File
@@ -1203,7 +1203,7 @@ static std::vector<std::string> s_Preset_print_options{
"post_process",
"slicing_pipeline_plugin",
"plugins",
"plugin_config_overrides",
"print_plugin_config_overrides",
"process_change_extrusion_role_gcode",
"min_length_factor",
"wall_maximum_resolution",
@@ -1378,7 +1378,7 @@ static std::vector<std::string> s_Preset_filament_options {/*"filament_colour",
"filament_preheat_temperature_delta", "filament_retract_length_nc",
"filament_change_length_nc", "filament_prime_volume", "filament_prime_volume_nc",
"long_retractions_when_ec", "retraction_distances_when_ec",
"plugin_config_overrides",
"filament_plugin_config_overrides",
//ams chamber
"filament_dev_ams_drying_ams_limitations", "filament_dev_ams_drying_temperature", "filament_dev_ams_drying_time", "filament_dev_ams_drying_heat_distortion_temperature",
"filament_dev_chamber_drying_bed_temperature", "filament_dev_chamber_drying_time",
@@ -1430,7 +1430,7 @@ static std::vector<std::string> s_Preset_printer_options {
// Fast-purge printer flag + device/firmware-facing per-variant extruder-change
// deretraction speed (unconsumed by the slicer; carried by H2D/A2L/X2D/P2S machine profiles).
"support_fast_purge_mode", "deretract_speed_extruder_change",
"plugin_config_overrides"
"printer_plugin_config_overrides"
};
static std::vector<std::string> s_Preset_sla_print_options {
@@ -1542,6 +1542,15 @@ const std::vector<std::string>& Preset::printer_options()
return s_opts;
}
const char* Preset::plugin_overrides_key(Type type)
{
switch (type) {
case TYPE_PRINTER: return "printer_plugin_config_overrides";
case TYPE_FILAMENT: return "filament_plugin_config_overrides";
default: return "print_plugin_config_overrides";
}
}
PresetCollection::PresetCollection(Preset::Type type, const std::vector<std::string> &keys, const Slic3r::StaticPrintConfig &defaults, const std::string &default_name) :
m_type(type),
m_edited_preset(type, "", false),