Toolchanger: fix an issue that wall_filament/sparse_infill_filament/solid_infill_filament didn't always work

This commit is contained in:
SoftFever 2024-08-04 00:54:03 +08:00
parent aaaa4f884e
commit 83c50b2ad1
4 changed files with 46 additions and 11 deletions

View file

@ -2887,11 +2887,11 @@ static void apply_to_print_region_config(PrintRegionConfig &out, const DynamicPr
// 1) Copy the "extruder key to sparse_infill_filament and wall_filament.
auto *opt_extruder = in.opt<ConfigOptionInt>(key_extruder);
if (opt_extruder)
if (int extruder = opt_extruder->value; extruder != 1) {
if (int extruder = opt_extruder->value; extruder != 0) {
// Not a default extruder.
out.sparse_infill_filament .value = extruder;
out.solid_infill_filament.value = extruder;
out.wall_filament .value = extruder;
out.sparse_infill_filament.value = extruder;
out.solid_infill_filament.value = extruder;
out.wall_filament.value = extruder;
}
// 2) Copy the rest of the values.
for (auto it = in.cbegin(); it != in.cend(); ++ it)