From 702f65c29cbd27a9d7e54a0bbab2cd1eac323c84 Mon Sep 17 00:00:00 2001 From: falken10vdl Date: Tue, 7 Jul 2026 11:41:53 +0200 Subject: [PATCH] Fix initila style when loading (default is SOLID - Flat: Shade) (cherry picked from commit 13c4ba257de75034808b30a4a866d9f33bb5deda) --- src/bonsai/bonsai/tool/style.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bonsai/bonsai/tool/style.py b/src/bonsai/bonsai/tool/style.py index 233d04866f..de2b35f900 100644 --- a/src/bonsai/bonsai/tool/style.py +++ b/src/bonsai/bonsai/tool/style.py @@ -1090,6 +1090,11 @@ class Style(bonsai.core.tool.Style): has_any_textures = True if shading_type == "SOLID": props.active_style_type = "Shading" + shading = style_elements.get("IfcSurfaceStyleRendering") or style_elements.get("IfcSurfaceStyleShading") + if shading: + d = tool.Loader.surface_style_to_dict(shading) + alpha = 1.0 - (d.get("Transparency") or 0.0) + material.diffuse_color = d["SurfaceColour"] + (alpha,) else: # MATERIAL_PREVIEW or RENDERED if cls.has_blender_external_style(style_elements) and not props.prefer_ifc_shading: props.active_style_type = "External"