From 394ae197fbe082ee32321b60bcae579262fa6df0 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 19 Dec 2017 23:24:30 +0100 Subject: [PATCH] fix broken transparency mode of mesh objects --- src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp index b73e99f0da..7ba2a3c796 100644 --- a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp +++ b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp @@ -76,8 +76,16 @@ void SoFCIndexedFaceSet::GLRender(SoGLRenderAction *action) if (this->coordIndex.getNum() < 3) return; - if (!this->shouldGLRender(action)) + if (!this->shouldGLRender(action)) { + // Transparency is handled inside 'shouldGLRender' but the base class + // somehow misses to reset the blending mode. This causes SoGLLazyElement + // not to switch on and off GL_BLEND mode and thus transparency doesn't + // work as expected. Calling SoMaterialBundle::sendFirst seems to fix the + // problem. + SoMaterialBundle mb(action); + mb.sendFirst(); return; + } SoState * state = action->getState(); SbBool mode = Gui::SoFCInteractiveElement::get(state);