mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-29 20:42:01 +08:00
Bugfix: When specific wipe tower extruder is set, the extruder indices for the placeholder parser are shifted
This commit is contained in:
parent
d6c721b42e
commit
2d6d37f685
@ -470,20 +470,16 @@ void ToolOrdering::fill_wipe_tower_partitions(const PrintConfig &config, coordf_
|
|||||||
bool ToolOrdering::insert_wipe_tower_extruder()
|
bool ToolOrdering::insert_wipe_tower_extruder()
|
||||||
{
|
{
|
||||||
// In case that wipe_tower_extruder is set to non-zero, we must make sure that the extruder will be in the list.
|
// In case that wipe_tower_extruder is set to non-zero, we must make sure that the extruder will be in the list.
|
||||||
|
// The list is 1-based, as is the config value !
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
if (m_print_config_ptr->wipe_tower_extruder != 0) {
|
if (m_print_config_ptr->wipe_tower_extruder != 0) {
|
||||||
for (LayerTools& lt : m_layer_tools) {
|
for (LayerTools& lt : m_layer_tools) {
|
||||||
if (lt.wipe_tower_partitions > 0) {
|
if (lt.wipe_tower_partitions > 0) {
|
||||||
lt.extruders.emplace_back(m_print_config_ptr->wipe_tower_extruder - 1);
|
lt.extruders.emplace_back(m_print_config_ptr->wipe_tower_extruder);
|
||||||
sort_remove_duplicates(lt.extruders);
|
sort_remove_duplicates(lt.extruders);
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Now convert the 0-based list to 1-based again.
|
|
||||||
for (LayerTools& lt : m_layer_tools) {
|
|
||||||
for (auto& extruder : lt.extruders)
|
|
||||||
++extruder;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user