From 993a5a6ac97c99334403d2be68ac123a58f773e1 Mon Sep 17 00:00:00 2001 From: Roy-043 <70520633+Roy-043@users.noreply.github.com> Date: Fri, 5 Sep 2025 19:17:16 +0200 Subject: [PATCH] BIM: fix transparency of windows --- src/Mod/BIM/ArchWindow.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Mod/BIM/ArchWindow.py b/src/Mod/BIM/ArchWindow.py index 6f30f0567c..f04fff0192 100644 --- a/src/Mod/BIM/ArchWindow.py +++ b/src/Mod/BIM/ArchWindow.py @@ -877,6 +877,7 @@ class _ViewProviderWindow(ArchComponent.ViewProviderComponent): if color is None: sapp_mat = base_sapp_mat else: + # color is an RGBA tuple (0.0-1.0) sapp_mat = FreeCAD.Material() # ShapeAppearance material with default v0.21 properties. sapp_mat.DiffuseColor = color[:3] + (1.0, ) sapp_mat.Transparency = 1.0 - color[3] @@ -895,6 +896,8 @@ class _ViewProviderWindow(ArchComponent.ViewProviderComponent): def getSolidMaterial(self,obj,arch_mat,name,mtype=None): + """returns an RGBA tuple of floats (0.0 - 1.0)""" + color = None if arch_mat is not None and hasattr(arch_mat,"Materials") and arch_mat.Names: mat = None @@ -908,7 +911,7 @@ class _ViewProviderWindow(ArchComponent.ViewProviderComponent): color = tuple([float(f) for f in mat.Material['DiffuseColor'].strip("()").split(",")]) if color and ('Transparency' in mat.Material): t = float(mat.Material['Transparency'])/100.0 - color = color[:3] + (t, ) + color = color[:3] + (1.0-t, ) return color def getHingeEdgeIndices(self):