From f3924249e910caa82fd7b169c000391d68b865de Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 13 Jul 2023 14:54:02 +0500 Subject: [PATCH] handle null diffuse color loading ifc styles The error was: Traceback (most recent call last): File "\3.6\scripts\addons\blenderbim\bim\module\style\prop.py", line 99, in update_shading_style tool.Style.set_surface_style_props(blender_material) File "\3.6\scripts\addons\blenderbim\tool\style.py", line 174, in set_surface_style_props style_data["DiffuseColour"] = style_data["DiffuseColour"][1] TypeError: 'NoneType' object is not subscriptable --- src/blenderbim/blenderbim/tool/style.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/blenderbim/blenderbim/tool/style.py b/src/blenderbim/blenderbim/tool/style.py index 0b540c7f5e..3b52333d42 100644 --- a/src/blenderbim/blenderbim/tool/style.py +++ b/src/blenderbim/blenderbim/tool/style.py @@ -171,7 +171,8 @@ class Style(blenderbim.core.tool.Style): style_data = tool.Loader.surface_style_to_dict(surface_style) if style_data["ReflectanceMethod"] == "NOTDEFINED": style_data["ReflectanceMethod"] = "PHYSICAL" - style_data["DiffuseColour"] = style_data["DiffuseColour"][1] + diffuse_color = style_data["DiffuseColour"] + style_data["DiffuseColour"] = diffuse_color[1] if diffuse_color else None for prop_blender, prop_ifc in STYLE_PROPS_MAP.items(): prop_value = style_data[prop_ifc]