mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-22 14:13:57 -06:00
Fixed import of color print view from gcode files into GCodeViewer
This commit is contained in:
parent
9cd61c7d0b
commit
8ebb2e2a29
10 changed files with 155 additions and 3 deletions
|
@ -6059,9 +6059,22 @@ std::vector<std::string> Plater::get_colors_for_color_print(const GCodeProcessor
|
|||
std::vector<std::string> colors = get_extruder_colors_from_plater_config(result);
|
||||
colors.reserve(colors.size() + p->model.custom_gcode_per_print_z.gcodes.size());
|
||||
|
||||
for (const CustomGCode::Item& code : p->model.custom_gcode_per_print_z.gcodes)
|
||||
if (code.type == CustomGCode::ColorChange)
|
||||
colors.emplace_back(code.color);
|
||||
#if ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER
|
||||
if (wxGetApp().is_gcode_viewer() && result != nullptr) {
|
||||
for (const CustomGCode::Item& code : result->custom_gcode_per_print_z) {
|
||||
if (code.type == CustomGCode::ColorChange)
|
||||
colors.emplace_back(code.color);
|
||||
}
|
||||
}
|
||||
else {
|
||||
#endif // ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER
|
||||
for (const CustomGCode::Item& code : p->model.custom_gcode_per_print_z.gcodes) {
|
||||
if (code.type == CustomGCode::ColorChange)
|
||||
colors.emplace_back(code.color);
|
||||
}
|
||||
#if ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER
|
||||
}
|
||||
#endif // ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER
|
||||
|
||||
return colors;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue