mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-25 20:24:24 +08:00
SPE-2624: Hotfix for empty thumbnails in shape gallery
This commit is contained in:
parent
bf5a815bef
commit
80a965ef12
@ -331,6 +331,11 @@ void MultipleBeds::move_from_bed_to_first_bed(Model& model, const int bed_index)
|
||||
|
||||
bool MultipleBeds::is_glvolume_on_thumbnail_bed(const Model& model, int obj_idx, int instance_idx) const
|
||||
{
|
||||
if (m_bed_for_thumbnails_generation == -2) {
|
||||
// Called from shape gallery, just render everything.
|
||||
return true;
|
||||
}
|
||||
|
||||
if (obj_idx < 0 || instance_idx < 0 || obj_idx >= int(model.objects.size()) || instance_idx >= int(model.objects[obj_idx]->instances.size()))
|
||||
return false;
|
||||
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "libslic3r/Model.hpp"
|
||||
#include "libslic3r/GCode/ThumbnailData.hpp"
|
||||
#include "libslic3r/Format/OBJ.hpp"
|
||||
#include "libslic3r/MultipleBeds.hpp"
|
||||
#include "../Utils/MacDarkMode.hpp"
|
||||
|
||||
namespace Slic3r {
|
||||
@ -305,7 +306,9 @@ static void generate_thumbnail_from_model(const std::string& filename)
|
||||
|
||||
ThumbnailData thumbnail_data;
|
||||
const ThumbnailsParams thumbnail_params = { {}, false, false, false, true };
|
||||
s_multiple_beds.set_thumbnail_bed_idx(-2);
|
||||
wxGetApp().plater()->canvas3D()->render_thumbnail(thumbnail_data, 256, 256, thumbnail_params, volumes, Camera::EType::Perspective);
|
||||
s_multiple_beds.set_thumbnail_bed_idx(-1);
|
||||
|
||||
if (thumbnail_data.width == 0 || thumbnail_data.height == 0)
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user