mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-13 10:39:04 +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;
|
||||
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)
|
||||
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) {
|
||||
const int obj_idx = vol->object_idx();
|
||||
const int vol_idx = vol->volume_idx();
|
||||
const bool render_as_painted = (obj_idx >= 0 && vol_idx >= 0) ?
|
||||
!model_objects[obj_idx]->volumes[vol_idx]->mmu_segmentation_facets.empty() : false;
|
||||
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();
|
||||
GLShaderProgram* shader = wxGetApp().get_shader(render_as_painted ? "mm_gouraud" : "gouraud_light");
|
||||
if (shader == nullptr)
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user