mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-14 19:12:38 -07:00
Fix the extruder override logic. All role-based extruder options now default to 0, meaning no override is defined and the default (inherited) extruder is used. The default extruder option does not use the shortcut logic anymore (it was thus moved to be a CLI-specific logic)
This commit is contained in:
@@ -4,4 +4,44 @@ namespace Slic3r {
|
||||
|
||||
t_optiondef_map PrintConfigDef::def = PrintConfigDef::build_def();
|
||||
|
||||
void
|
||||
StaticPrintConfig::prepare_extruder_option(const t_config_option_key opt_key, DynamicPrintConfig& other)
|
||||
{
|
||||
// don't apply role-based extruders if their value is zero
|
||||
if (other.has(opt_key) && other.option(opt_key)->getInt() == 0)
|
||||
other.erase(opt_key);
|
||||
|
||||
// only apply default extruder if our role-based value is zero
|
||||
// (i.e. default extruder has the lowest priority among all other values)
|
||||
if (other.has("extruder")) {
|
||||
int extruder = other.option("extruder")->getInt();
|
||||
if (extruder > 0) {
|
||||
if (!other.has(opt_key) && this->option(opt_key)->getInt() == 0)
|
||||
other.option(opt_key, true)->setInt(extruder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
PrintObjectConfig::apply(const ConfigBase &other, bool ignore_nonexistent) {
|
||||
DynamicPrintConfig other_clone;
|
||||
other_clone.apply(other);
|
||||
|
||||
this->prepare_extruder_option("support_material_extruder", other_clone);
|
||||
this->prepare_extruder_option("support_material_interface_extruder", other_clone);
|
||||
|
||||
StaticConfig::apply(other_clone, ignore_nonexistent);
|
||||
};
|
||||
|
||||
void
|
||||
PrintRegionConfig::apply(const ConfigBase &other, bool ignore_nonexistent) {
|
||||
DynamicPrintConfig other_clone;
|
||||
other_clone.apply(other);
|
||||
|
||||
this->prepare_extruder_option("infill_extruder", other_clone);
|
||||
this->prepare_extruder_option("perimeter_extruder", other_clone);
|
||||
|
||||
StaticConfig::apply(other_clone, ignore_nonexistent);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user