diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index c062adf4b..e16687cd9 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -4893,7 +4893,11 @@ const DynamicPrintConfig* Plater::get_plater_config() const std::vector Plater::get_extruder_colors_from_plater_config() const { const Slic3r::DynamicPrintConfig* config = &wxGetApp().preset_bundle->printers.get_edited_preset().config; - std::vector extruder_colors = (config->option("extruder_colour"))->values; + std::vector extruder_colors; + if (!config->has("extruder_colour")) // in case of a SLA print + return extruder_colors; + + extruder_colors = (config->option("extruder_colour"))->values; const std::vector& filament_colours = (p->config->option("filament_colour"))->values; for (size_t i = 0; i < extruder_colors.size(); ++i) if (extruder_colors[i] == "" && i < filament_colours.size()) diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp index e0ee47b61..0109f6a29 100644 --- a/src/slic3r/GUI/wxExtensions.cpp +++ b/src/slic3r/GUI/wxExtensions.cpp @@ -455,6 +455,9 @@ Slic3r::GUI::BitmapCache* m_bitmap_cache = nullptr; std::vector bmps; std::vector colors = Slic3r::GUI::wxGetApp().plater()->get_extruder_colors_from_plater_config(); + if (bmps.empty()) + return bmps; + unsigned char rgb[3]; /* It's supposed that standard size of an icon is 36px*16px for 100% scaled display. @@ -484,6 +487,8 @@ static wxBitmap get_extruder_color_icon(size_t extruder_idx) { // Create the bitmap with color bars. std::vector bmps = get_extruder_color_icons(); + if (bmps.empty()) + return wxNullBitmap; return *bmps[extruder_idx >= bmps.size() ? 0 : extruder_idx]; }