Fix #2813. Bug where the user could try to load thumbnails even though there were no types.

This commit is contained in:
Dion Moult
2023-02-28 08:44:36 +11:00
parent 17add48254
commit affb066b7b
@@ -379,12 +379,13 @@ class BimToolUI:
def draw_basic_bim_tool_interface(cls): def draw_basic_bim_tool_interface(cls):
cls.draw_type_selection_interface() cls.draw_type_selection_interface()
box = cls.layout.box() if cls.props.ifc_class:
if AuthoringData.data["type_thumbnail"]: box = cls.layout.box()
box.template_icon(icon_value=AuthoringData.data["type_thumbnail"], scale=5) if AuthoringData.data["type_thumbnail"]:
else: box.template_icon(icon_value=AuthoringData.data["type_thumbnail"], scale=5)
op = box.operator("bim.load_type_thumbnails", text="Load Thumbnails", icon="FILE_REFRESH") else:
op.ifc_class = cls.props.ifc_class op = box.operator("bim.load_type_thumbnails", text="Load Thumbnails", icon="FILE_REFRESH")
op.ifc_class = cls.props.ifc_class
if AuthoringData.data["ifc_classes"]: if AuthoringData.data["ifc_classes"]:
row = cls.layout.row(align=True) row = cls.layout.row(align=True)