From 289195ae14199379142f0bf0cf8cebb35eb21869 Mon Sep 17 00:00:00 2001 From: Morton Jonuschat Date: Fri, 20 Dec 2024 22:14:28 -0800 Subject: [PATCH] [BUGFIX] Show active bed texture when bed model overlaps When bed models are too large they are automatically hidden when another bed is added to avoid awkward spacing between beds/overlaps. This also results in the bed texture being hidden and falling back to the default "translucent" grid view. This bugfix changes the behavior to show the bed texture on the active bed even when the model is hidden which should be save as the texture is always scaled to the bed size. Original bug report: #13791 --- src/slic3r/GUI/3DBed.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/3DBed.cpp b/src/slic3r/GUI/3DBed.cpp index 27d475d762..b2f7632113 100644 --- a/src/slic3r/GUI/3DBed.cpp +++ b/src/slic3r/GUI/3DBed.cpp @@ -406,13 +406,17 @@ void Bed3D::render_axes() void Bed3D::render_system(GLCanvas3D& canvas, const Transform3d& view_matrix, const Transform3d& projection_matrix, bool bottom, bool show_texture, bool is_active) { - if (m_models_overlap && s_multiple_beds.get_number_of_beds() + int(s_multiple_beds.should_show_next_bed()) > 1) { + if (m_texture_filename.empty() && m_model_filename.empty()) { render_default(bottom, false, show_texture, view_matrix, projection_matrix); return; } - if (!bottom) + if (m_models_overlap && s_multiple_beds.get_number_of_beds() + int(s_multiple_beds.should_show_next_bed()) > 1) { + if (m_texture_filename.empty()) + render_default(bottom, false, show_texture, view_matrix, projection_matrix); + } else if (!bottom) { render_model(view_matrix, projection_matrix); + } if (show_texture) render_texture(bottom, canvas, view_matrix, projection_matrix, is_active); @@ -574,14 +578,17 @@ void Bed3D::render_model(const Transform3d& view_matrix, const Transform3d& proj void Bed3D::render_custom(GLCanvas3D& canvas, const Transform3d& view_matrix, const Transform3d& projection_matrix, bool bottom, bool show_texture, bool picking, bool is_active) { - if ((m_texture_filename.empty() && m_model_filename.empty()) - || (m_models_overlap && s_multiple_beds.get_number_of_beds() + int(s_multiple_beds.should_show_next_bed()) > 1)) { + if (m_texture_filename.empty() && m_model_filename.empty()) { render_default(bottom, picking, show_texture, view_matrix, projection_matrix); return; } - if (!bottom) + if (m_models_overlap && s_multiple_beds.get_number_of_beds() + int(s_multiple_beds.should_show_next_bed()) > 1) { + if (m_texture_filename.empty()) + render_default(bottom, false, show_texture, view_matrix, projection_matrix); + } else if (!bottom) { render_model(view_matrix, projection_matrix); + } if (show_texture) render_texture(bottom, canvas, view_matrix, projection_matrix, is_active);