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):
cls.draw_type_selection_interface()
box = cls.layout.box()
if AuthoringData.data["type_thumbnail"]:
box.template_icon(icon_value=AuthoringData.data["type_thumbnail"], scale=5)
else:
op = box.operator("bim.load_type_thumbnails", text="Load Thumbnails", icon="FILE_REFRESH")
op.ifc_class = cls.props.ifc_class
if cls.props.ifc_class:
box = cls.layout.box()
if AuthoringData.data["type_thumbnail"]:
box.template_icon(icon_value=AuthoringData.data["type_thumbnail"], scale=5)
else:
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"]:
row = cls.layout.row(align=True)