mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-10 05:52:44 +00:00
Preserve explicit feature filament overrides
Keep legacy "Filament for Features" behavior by treating an explicit sparse-infill filament choice as an override even when enable_infill_filament_override is not set. In ToolOrdering.cpp add explicit_sparse_override detection (sparse_infill_filament != wall_filament and both > 0) so base-infill logic respects explicit feature filament selection. In PrintObject.cpp stop clearing feature override flags when an extruder is set to "Default" (0), so parent-scope feature overrides are preserved instead of being reset. This avoids unintentionally removing feature filament overrides when a scope uses the default extruder.
This commit is contained in:
@@ -104,7 +104,16 @@ bool internal_solid_infill_uses_sparse_filament(const PrintRegion ®ion, Extru
|
||||
bool use_base_infill_filament_impl(const LayerTools &layer_tools, const PrintRegion ®ion)
|
||||
{
|
||||
const PrintRegionConfig &config = region.config();
|
||||
if (!config.enable_infill_filament_override.value)
|
||||
|
||||
// Keep legacy "Filament for Features" behavior: an explicit sparse infill
|
||||
// filament choice (different from wall filament) is an override even if the
|
||||
// dedicated toggle is missing or false in the loaded config.
|
||||
const bool explicit_sparse_override =
|
||||
config.sparse_infill_filament.value > 0 &&
|
||||
config.wall_filament.value > 0 &&
|
||||
config.sparse_infill_filament.value != config.wall_filament.value;
|
||||
|
||||
if (!config.enable_infill_filament_override.value && !explicit_sparse_override)
|
||||
return true;
|
||||
if (layer_tools.object_layer_count <= 0)
|
||||
return false;
|
||||
|
||||
@@ -3578,7 +3578,8 @@ static void apply_to_print_region_config(PrintRegionConfig &out, const DynamicPr
|
||||
if (it->first != key_extruder)
|
||||
if (ConfigOption* my_opt = out.option(it->first, false); my_opt != nullptr) {
|
||||
if (one_of(it->first, keys_extruders)) {
|
||||
// "Default" (0) clears explicit override for this scope and lets fallback apply.
|
||||
// "Default" (0) keeps any prior explicit feature override from parent scopes.
|
||||
// This lets object/part base filament be the default unless an explicit feature filament was chosen.
|
||||
int extruder = static_cast<const ConfigOptionInt*>(it->second.get())->value;
|
||||
if (extruder > 0) {
|
||||
my_opt->setInt(extruder);
|
||||
@@ -3588,13 +3589,6 @@ static void apply_to_print_region_config(PrintRegionConfig &out, const DynamicPr
|
||||
feature_overrides.solid_infill_filament = true;
|
||||
else if (it->first == "wall_filament")
|
||||
feature_overrides.wall_filament = true;
|
||||
} else {
|
||||
if (it->first == "sparse_infill_filament")
|
||||
feature_overrides.sparse_infill_filament = false;
|
||||
else if (it->first == "solid_infill_filament")
|
||||
feature_overrides.solid_infill_filament = false;
|
||||
else if (it->first == "wall_filament")
|
||||
feature_overrides.wall_filament = false;
|
||||
}
|
||||
} else
|
||||
my_opt->set(it->second.get());
|
||||
|
||||
Reference in New Issue
Block a user