mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-01-09 16:27:45 -07:00
Fix gcode viewer wrong layer count when selected printer model is BBL while gcode is not
This commit is contained in:
parent
43693ebba9
commit
763bdb5dee
1 changed files with 7 additions and 0 deletions
|
|
@ -2440,6 +2440,13 @@ void GCodeProcessor::process_file(const std::string& filename, std::function<voi
|
|||
// thus a probability of incorrect substitution is low and the G-code viewer is a consumer-only anyways.
|
||||
config.load_from_gcode_file(filename, ForwardCompatibilitySubstitutionRule::EnableSilent);
|
||||
|
||||
// Get the correct printer vendor based on the `printer_model` field
|
||||
auto printer_model_opt = config.opt<ConfigOptionString>("printer_model");
|
||||
if (printer_model_opt && !printer_model_opt->value.empty()) {
|
||||
// TODO: Orca hack, proper vendor check?
|
||||
GCodeProcessor::s_IsBBLPrinter = boost::starts_with(printer_model_opt->value, "Bambu Lab");
|
||||
}
|
||||
|
||||
ConfigOptionStrings *filament_color = config.opt<ConfigOptionStrings>("filament_colour");
|
||||
ConfigOptionInts *filament_map = config.opt<ConfigOptionInts>("filament_map", true);
|
||||
if (filament_color && filament_color->size() != filament_map->size()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue