mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-19 12:47:50 -06:00
fix is_extruder_used (#1422)
This commit is contained in:
parent
3fee164058
commit
e925db8c0f
1 changed files with 5 additions and 1 deletions
|
@ -1728,7 +1728,11 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
|||
//m_placeholder_parser.set("has_single_extruder_multi_material_priming", has_wipe_tower && print.config().single_extruder_multi_material_priming);
|
||||
m_placeholder_parser.set("total_toolchanges", std::max(0, print.wipe_tower_data().number_of_toolchanges)); // Check for negative toolchanges (single extruder mode) and set to 0 (no tool change).
|
||||
|
||||
std::vector<unsigned char> is_extruder_used(print.config().filament_diameter.size(), 0);
|
||||
// PlaceholderParser currently substitues non-existent vector values with the zero'th value, which is harmful in the
|
||||
// case of "is_extruder_used[]" as Slicer may lie about availability of such non-existent extruder. We rather
|
||||
// sacrifice 256B of memory before we change the behavior of the PlaceholderParser, which should really only fill in
|
||||
// the non-existent vector elements for filament parameters.
|
||||
std::vector<unsigned char> is_extruder_used(std::max(size_t(255), print.config().filament_diameter.size()), 0);
|
||||
for (unsigned int extruder : tool_ordering.all_extruders())
|
||||
is_extruder_used[extruder] = true;
|
||||
m_placeholder_parser.set("is_extruder_used", new ConfigOptionBools(is_extruder_used));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue