Fix bug where you couldn't add layers to a fresh project

This commit is contained in:
Dion Moult
2021-03-14 10:26:58 +11:00
parent 510dca1aca
commit 4564ee3476
@@ -21,17 +21,13 @@ class BIM_PT_layers(Panel):
self.props = context.scene.BIMLayerProperties self.props = context.scene.BIMLayerProperties
if Data.layers: row = self.layout.row(align=True)
row = self.layout.row(align=True) row.label(text="{} Layers Found".format(len(Data.layers.keys())))
row.label(text="{} Layers Found".format(len(Data.layers.keys()))) if self.props.is_editing:
if self.props.is_editing: row.operator("bim.add_presentation_layer", text="", icon="ADD")
row.operator("bim.add_presentation_layer", text="", icon="ADD") row.operator("bim.disable_layer_editing_ui", text="", icon="X")
row.operator("bim.disable_layer_editing_ui", text="", icon="X")
else:
row.operator("bim.load_layers", text="", icon="IMPORT")
else: else:
row = self.layout.row(align=True) row.operator("bim.load_layers", text="", icon="GREASEPENCIL")
row.label(text="No Layers")
if self.props.is_editing: if self.props.is_editing:
self.layout.template_list( self.layout.template_list(