Support IFC2X3 materials without transparency

This commit is contained in:
Dion Moult
2020-03-06 22:03:01 +11:00
parent e2cfc676d8
commit 3a91ed1382
@@ -96,7 +96,9 @@ class MaterialCreator():
for surface_style in style.Styles:
if surface_style.is_a('IfcSurfaceStyleShading'):
alpha = 1.
if surface_style.Transparency:
# Transparency was added in IFC4
if hasattr(surface_style, 'Transparency') \
and surface_style.Transparency:
alpha = 1 - surface_style.Transparency
material.diffuse_color = (
surface_style.SurfaceColour.Red,