From 1ba3f0a4f6d9c7a9abb13f30116130eb2efeab04 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Wed, 27 Nov 2019 13:37:37 +0100 Subject: [PATCH] Transparent background for thumbnails saved into gcode and sl1 files --- src/libslic3r/GCode.cpp | 2 +- src/slic3r/GUI/BackgroundSlicingProcess.cpp | 8 ++++---- src/slic3r/GUI/GLCanvas3D.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 014deb79c..f9a16e1ad 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -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("thumbnails")->values, true, true, false); + thumbnail_cb(thumbnails, print.full_print_config().option("thumbnails")->values, true, true, true); for (const ThumbnailData& data : thumbnails) { if (data.is_valid()) diff --git a/src/slic3r/GUI/BackgroundSlicingProcess.cpp b/src/slic3r/GUI/BackgroundSlicingProcess.cpp index 570841a45..8d64ecf43 100644 --- a/src/slic3r/GUI/BackgroundSlicingProcess.cpp +++ b/src/slic3r/GUI/BackgroundSlicingProcess.cpp @@ -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("thumbnails")->values, true, true, false); -// m_thumbnail_cb(thumbnails, current_print()->full_print_config().option("thumbnails")->values, true, false, false); // renders also supports and pad + m_thumbnail_cb(thumbnails, current_print()->full_print_config().option("thumbnails")->values, true, true, true); +// m_thumbnail_cb(thumbnails, current_print()->full_print_config().option("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("thumbnails")->values, true, true, false); -// m_thumbnail_cb(thumbnails, current_print()->full_print_config().option("thumbnails")->values, true, false, false); // renders also supports and pad + m_thumbnail_cb(thumbnails, current_print()->full_print_config().option("thumbnails")->values, true, true, true); +// m_thumbnail_cb(thumbnails, current_print()->full_print_config().option("thumbnails")->values, true, false, true); // renders also supports and pad for (const ThumbnailData& data : thumbnails) { if (data.is_valid()) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 7160b0128..1af1f8e40 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -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));