Follow up on the hot fix of #3637 53bfb6bed3
This is the correct solution, which maintains the optimization introduced
by 3e0690b37b
This commit is contained in:
parent
a5de3386ac
commit
bfbf3ac94d
1 changed files with 10 additions and 15 deletions
|
@ -2123,21 +2123,16 @@ void GCode::process_layer(
|
||||||
|
|
||||||
// Let's recover vector of extruder overrides:
|
// Let's recover vector of extruder overrides:
|
||||||
const WipingExtrusions::ExtruderPerCopy *entity_overrides = nullptr;
|
const WipingExtrusions::ExtruderPerCopy *entity_overrides = nullptr;
|
||||||
// see GH issue #3637: Object disappears when wipe to object turned on
|
if (! layer_tools.has_extruder(correct_extruder_id)) {
|
||||||
//FIXME Vojtec With the optimization disabled, the G-code generator will not be slower
|
// this entity is not overridden, but its extruder is not in layer_tools - we'll print it
|
||||||
// than PrusaSlicer 2.1.1. I am leaving the code there to mark for further optimization opportunities.
|
// by last extruder on this layer (could happen e.g. when a wiping object is taller than others - dontcare extruders are eradicated from layer_tools)
|
||||||
//if (is_anything_overridden)
|
correct_extruder_id = layer_tools.extruders.back();
|
||||||
if (true)
|
}
|
||||||
{
|
printing_extruders.clear();
|
||||||
printing_extruders.clear();
|
if (is_anything_overridden) {
|
||||||
if (! layer_tools.has_extruder(correct_extruder_id)) {
|
|
||||||
// this entity is not overridden, but its extruder is not in layer_tools - we'll print it
|
|
||||||
// by last extruder on this layer (could happen e.g. when a wiping object is taller than others - dontcare extruders are eradicated from layer_tools)
|
|
||||||
correct_extruder_id = layer_tools.extruders.back();
|
|
||||||
}
|
|
||||||
entity_overrides = const_cast<LayerTools&>(layer_tools).wiping_extrusions().get_extruder_overrides(extrusions, correct_extruder_id, layer_to_print.object()->instances().size());
|
entity_overrides = const_cast<LayerTools&>(layer_tools).wiping_extrusions().get_extruder_overrides(extrusions, correct_extruder_id, layer_to_print.object()->instances().size());
|
||||||
if (entity_overrides == nullptr) {
|
if (entity_overrides == nullptr) {
|
||||||
printing_extruders.emplace_back(correct_extruder_id);
|
printing_extruders.emplace_back(correct_extruder_id);
|
||||||
} else {
|
} else {
|
||||||
printing_extruders.reserve(entity_overrides->size());
|
printing_extruders.reserve(entity_overrides->size());
|
||||||
for (int extruder : *entity_overrides)
|
for (int extruder : *entity_overrides)
|
||||||
|
@ -2146,10 +2141,10 @@ void GCode::process_layer(
|
||||||
extruder :
|
extruder :
|
||||||
// at least one copy would normally be printed with this extruder (see get_extruder_overrides function for explanation)
|
// at least one copy would normally be printed with this extruder (see get_extruder_overrides function for explanation)
|
||||||
static_cast<unsigned int>(- extruder - 1));
|
static_cast<unsigned int>(- extruder - 1));
|
||||||
|
Slic3r::sort_remove_duplicates(printing_extruders);
|
||||||
}
|
}
|
||||||
Slic3r::sort_remove_duplicates(printing_extruders);
|
|
||||||
} else
|
} else
|
||||||
printing_extruders = { (unsigned int)correct_extruder_id };
|
printing_extruders.emplace_back(correct_extruder_id);
|
||||||
|
|
||||||
// Now we must add this extrusion into the by_extruder map, once for each extruder that will print it:
|
// Now we must add this extrusion into the by_extruder map, once for each extruder that will print it:
|
||||||
for (unsigned int extruder : printing_extruders)
|
for (unsigned int extruder : printing_extruders)
|
||||||
|
|
Loading…
Add table
Reference in a new issue