mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
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
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user