mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-14 09:02:06 +00:00
Fix gcode viewer wrong layer count when selected printer model is BBL while gcode is not
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user