Transparent background for thumbnails saved into gcode and sl1 files

This commit is contained in:
Enrico Turri 2019-11-27 13:37:37 +01:00
parent 5fcf41a3aa
commit 1ba3f0a4f6
3 changed files with 6 additions and 6 deletions

View file

@ -991,7 +991,7 @@ void GCode::_do_export(Print& print, FILE* file)
{
const size_t max_row_length = 78;
ThumbnailsList thumbnails;
thumbnail_cb(thumbnails, print.full_print_config().option<ConfigOptionPoints>("thumbnails")->values, true, true, false);
thumbnail_cb(thumbnails, print.full_print_config().option<ConfigOptionPoints>("thumbnails")->values, true, true, true);
for (const ThumbnailData& data : thumbnails)
{
if (data.is_valid())

View file

@ -139,8 +139,8 @@ void BackgroundSlicingProcess::process_sla()
if (m_thumbnail_cb != nullptr)
{
ThumbnailsList thumbnails;
m_thumbnail_cb(thumbnails, current_print()->full_print_config().option<ConfigOptionPoints>("thumbnails")->values, true, true, false);
// m_thumbnail_cb(thumbnails, current_print()->full_print_config().option<ConfigOptionPoints>("thumbnails")->values, true, false, false); // renders also supports and pad
m_thumbnail_cb(thumbnails, current_print()->full_print_config().option<ConfigOptionPoints>("thumbnails")->values, true, true, true);
// m_thumbnail_cb(thumbnails, current_print()->full_print_config().option<ConfigOptionPoints>("thumbnails")->values, true, false, true); // renders also supports and pad
for (const ThumbnailData& data : thumbnails)
{
if (data.is_valid())
@ -464,8 +464,8 @@ void BackgroundSlicingProcess::prepare_upload()
if (m_thumbnail_cb != nullptr)
{
ThumbnailsList thumbnails;
m_thumbnail_cb(thumbnails, current_print()->full_print_config().option<ConfigOptionPoints>("thumbnails")->values, true, true, false);
// m_thumbnail_cb(thumbnails, current_print()->full_print_config().option<ConfigOptionPoints>("thumbnails")->values, true, false, false); // renders also supports and pad
m_thumbnail_cb(thumbnails, current_print()->full_print_config().option<ConfigOptionPoints>("thumbnails")->values, true, true, true);
// m_thumbnail_cb(thumbnails, current_print()->full_print_config().option<ConfigOptionPoints>("thumbnails")->values, true, false, true); // renders also supports and pad
for (const ThumbnailData& data : thumbnails)
{
if (data.is_valid())

View file

@ -3847,7 +3847,7 @@ static void render_volumes_in_thumbnail(Shader& shader, const GLVolumePtrs& volu
camera.apply_projection(box);
if (transparent_background)
glsafe(::glClearColor(1.0f, 1.0f, 1.0f, 0.0f));
glsafe(::glClearColor(0.0f, 0.0f, 0.0f, 0.0f));
glsafe(::glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT));
glsafe(::glEnable(GL_DEPTH_TEST));