mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 13:55:58 +08:00
SPE-2075: Fixed crash during thumbnail generation for SLA printers.
This commit is contained in:
parent
33b13b937c
commit
9a3c831020
@ -4907,6 +4907,7 @@ void GLCanvas3D::_render_thumbnail_internal(ThumbnailData& thumbnail_data, const
|
|||||||
|
|
||||||
const ModelObjectPtrs &model_objects = GUI::wxGetApp().model().objects;
|
const ModelObjectPtrs &model_objects = GUI::wxGetApp().model().objects;
|
||||||
std::vector<ColorRGBA> extruders_colors = get_extruders_colors();
|
std::vector<ColorRGBA> extruders_colors = get_extruders_colors();
|
||||||
|
const bool is_enabled_painted_thumbnail = !model_objects.empty() && !extruders_colors.empty();
|
||||||
|
|
||||||
if (thumbnail_params.transparent_background)
|
if (thumbnail_params.transparent_background)
|
||||||
glsafe(::glClearColor(0.0f, 0.0f, 0.0f, 0.0f));
|
glsafe(::glClearColor(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
@ -4921,8 +4922,7 @@ void GLCanvas3D::_render_thumbnail_internal(ThumbnailData& thumbnail_data, const
|
|||||||
for (GLVolume *vol : visible_volumes) {
|
for (GLVolume *vol : visible_volumes) {
|
||||||
const int obj_idx = vol->object_idx();
|
const int obj_idx = vol->object_idx();
|
||||||
const int vol_idx = vol->volume_idx();
|
const int vol_idx = vol->volume_idx();
|
||||||
const bool render_as_painted = (obj_idx >= 0 && vol_idx >= 0) ?
|
const bool render_as_painted = is_enabled_painted_thumbnail && obj_idx >= 0 && vol_idx >= 0 && !model_objects[obj_idx]->volumes[vol_idx]->mmu_segmentation_facets.empty();
|
||||||
!model_objects[obj_idx]->volumes[vol_idx]->mmu_segmentation_facets.empty() : false;
|
|
||||||
GLShaderProgram* shader = wxGetApp().get_shader(render_as_painted ? "mm_gouraud" : "gouraud_light");
|
GLShaderProgram* shader = wxGetApp().get_shader(render_as_painted ? "mm_gouraud" : "gouraud_light");
|
||||||
if (shader == nullptr)
|
if (shader == nullptr)
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user