Arch/Draft: Fix transparency vs. alpha issues

Fix #18295
This commit is contained in:
wmayer
2024-12-07 16:17:37 +01:00
committed by Yorik van Havre
parent 8d0efd4b21
commit 4666fe8a5b
9 changed files with 13 additions and 13 deletions

View File

@@ -473,12 +473,12 @@ class _ViewProviderPanel(ArchComponent.ViewProviderComponent):
cols = []
for i,mat in enumerate(activematerials):
c = obj.ViewObject.ShapeColor
c = (c[0],c[1],c[2],obj.ViewObject.Transparency/100.0)
c = (c[0],c[1],c[2],1.0-obj.ViewObject.Transparency/100.0)
if 'DiffuseColor' in mat.Material:
if "(" in mat.Material['DiffuseColor']:
c = tuple([float(f) for f in mat.Material['DiffuseColor'].strip("()").split(",")])
if 'Transparency' in mat.Material:
c = (c[0],c[1],c[2],float(mat.Material['Transparency']))
c = (c[0],c[1],c[2],1.0-float(mat.Material['Transparency']))
cols.extend([c for j in range(len(obj.Shape.Solids[i].Faces))])
if obj.ViewObject.DiffuseColor != cols:
obj.ViewObject.DiffuseColor = cols