mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-28 03:11:47 +00:00
Apply the GUI's Mixed Filament Rules on the CLI (#15636)
A valid mixed filament already slices the same on the CLI as in the GUI; these are the places where the CLI still skipped a rule the GUI applies. - Keep the prime tower when a mixed filament is used, even if every --load-filaments preset is the same. A mixed filament swaps between its components every layer, so turning the tower off left the swaps with nothing to purge on. - Leave a mixed slot's row and column of the flush matrix at zero when --filament-colour triggers a recompute, as the GUI does; a mixed slot never reaches a nozzle. - Refuse a mixed slot that has no filament of its own. Feature filament ids aimed at it were past the filament count, got reset to filament 1 and the model silently printed in one colour. - Refuse a plate that uses a mixed filament whose components are different filament types, the type half of the GUI's Sidebar::has_broken_mixed_filament. Missing or out-of-range components are already rejected for the whole project by validate(). get_extruders_under_cli gains an expand_mixed_slots flag so the gate can see mixed slots rather than their components; existing callers keep the expanded list. Both refusals exit with the new CLI_MIXED_FILAMENT_INVALID (-69).
This commit is contained in:
@@ -350,7 +350,8 @@ public:
|
||||
// get used filaments from config, 1 based idx
|
||||
std::vector<int> get_extruders(bool conside_custom_gcode = false) const;
|
||||
std::vector<int> get_extruders(bool conside_custom_gcode, const DynamicPrintConfig& glb_config, const DynamicPrintConfig& project_config) const;
|
||||
std::vector<int> get_extruders_under_cli(bool conside_custom_gcode, DynamicPrintConfig& full_config) const;
|
||||
// expand_mixed_slots = false keeps mixed filament slots as slots instead of their components.
|
||||
std::vector<int> get_extruders_under_cli(bool conside_custom_gcode, DynamicPrintConfig& full_config, bool expand_mixed_slots = true) const;
|
||||
std::vector<int> get_extruders_without_support(bool conside_custom_gcode = false) const;
|
||||
// get used filaments from gcode result, 1 based idx
|
||||
std::vector<int> get_used_filaments();
|
||||
|
||||
Reference in New Issue
Block a user