Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukáš Hejl <hejl.lukas@gmail.com>2021-06-03 09:00:46 +0300
committerLukáš Hejl <hejl.lukas@gmail.com>2021-06-03 09:00:46 +0300
commit94877a0ec0d0575b4bd2c8389c3111ec2257b5f8 (patch)
tree574128b6bab021ca2890450b552bcd19ebb45dd1 /src/slic3r/GUI
parent9efe58e6c75eb8941d9c54d492e3f7e9b0b2c6c9 (diff)
Fixed the wrong transformation matrix for "Clipping of view" when is used a printer with multiple extruders.vb_print_regions
Diffstat (limited to 'src/slic3r/GUI')
-rw-r--r--src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp
index 4ba9eaf05..ec3a7c4d9 100644
--- a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp
+++ b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp
@@ -132,6 +132,7 @@ void GLGizmoPainterBase::render_triangles(const Selection& selection) const
glsafe(::glEnable(GL_CLIP_PLANE0));
}
+ auto *shader = wxGetApp().get_shader("gouraud");
int mesh_id = -1;
for (const ModelVolume* mv : mo->volumes) {
if (! mv->is_model_part())
@@ -150,6 +151,16 @@ void GLGizmoPainterBase::render_triangles(const Selection& selection) const
glsafe(::glPushMatrix());
glsafe(::glMultMatrixd(trafo_matrix.data()));
+ // For printers with multiple extruders, it is necessary to pass trafo_matrix
+ // to the shader input variable print_box.volume_world_matrix before
+ // rendering the painted triangles. When this matrix is not set, the
+ // wrong transformation matrix is used for "Clipping of view".
+ if (shader) {
+ shader->start_using();
+ shader->set_uniform("print_box.volume_world_matrix", trafo_matrix);
+ shader->stop_using();
+ }
+
m_triangle_selectors[mesh_id]->render(m_imgui);
glsafe(::glPopMatrix());