From 69e447be1c3cecab8defda21ba359883a8cfc9ac Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Fri, 6 Oct 2023 08:16:56 +1100 Subject: [PATCH] Active drawing panel moved from camera properties to drawing tab. --- src/blenderbim/blenderbim/bim/__init__.py | 4 ++ .../blenderbim/bim/module/drawing/__init__.py | 4 +- .../blenderbim/bim/module/drawing/ui.py | 41 ++++++------- src/blenderbim/blenderbim/bim/ui.py | 60 +++++++++++++++++++ 4 files changed, 83 insertions(+), 26 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/__init__.py b/src/blenderbim/blenderbim/bim/__init__.py index ccafb12784..8e90e72cc1 100644 --- a/src/blenderbim/blenderbim/bim/__init__.py +++ b/src/blenderbim/blenderbim/bim/__init__.py @@ -142,6 +142,10 @@ classes = [ ui.BIM_PT_tab_materials, ui.BIM_PT_tab_styles, # Drawings and documents + ui.BIM_PT_tab_sheets, + ui.BIM_PT_tab_drawings, + ui.BIM_PT_tab_schedules, + ui.BIM_PT_tab_references, # Services and systems ui.BIM_PT_tab_services, ui.BIM_PT_tab_services_object, diff --git a/src/blenderbim/blenderbim/bim/module/drawing/__init__.py b/src/blenderbim/blenderbim/bim/module/drawing/__init__.py index 031d4a4972..6e0e9f80d2 100644 --- a/src/blenderbim/blenderbim/bim/module/drawing/__init__.py +++ b/src/blenderbim/blenderbim/bim/module/drawing/__init__.py @@ -92,10 +92,10 @@ classes = ( prop.BIMTextProperties, prop.BIMAssignedProductProperties, prop.BIMAnnotationProperties, - ui.BIM_PT_camera, - ui.BIM_PT_drawing_underlay, ui.BIM_PT_sheets, ui.BIM_PT_drawings, + ui.BIM_PT_camera, + ui.BIM_PT_drawing_underlay, ui.BIM_PT_schedules, ui.BIM_PT_references, ui.BIM_PT_product_assignments, diff --git a/src/blenderbim/blenderbim/bim/module/drawing/ui.py b/src/blenderbim/blenderbim/bim/module/drawing/ui.py index e96eb9defe..4784b48354 100644 --- a/src/blenderbim/blenderbim/bim/module/drawing/ui.py +++ b/src/blenderbim/blenderbim/bim/module/drawing/ui.py @@ -31,17 +31,18 @@ from blenderbim.bim.module.drawing.prop import ANNOTATION_TYPES_DATA class BIM_PT_camera(Panel): - bl_label = "Drawing Generation" + bl_label = "Active Drawing" bl_idname = "BIM_PT_camera" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" - bl_context = "data" - - @classmethod - def poll(cls, context): - return context.camera and hasattr(context.active_object.data, "BIMCameraProperties") + bl_context = "scene" + bl_parent_id = "BIM_PT_tab_drawings" def draw(self, context): + if not (context.scene.camera and hasattr(context.active_object.data, "BIMCameraProperties")): + row = self.layout.row() + row.label(text="No Active Drawing", icon="ERROR") + layout = self.layout if "/" not in context.active_object.name: @@ -97,12 +98,12 @@ class BIM_PT_drawing_underlay(Panel): bl_options = {"DEFAULT_CLOSED"} bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" - bl_context = "data" + bl_context = "scene" bl_parent_id = "BIM_PT_camera" @classmethod def poll(cls, context): - return context.camera and hasattr(context.active_object.data, "BIMCameraProperties") + return context.scene.camera and hasattr(context.active_object.data, "BIMCameraProperties") def draw(self, context): layout = self.layout @@ -164,10 +165,8 @@ class BIM_PT_drawings(Panel): bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "scene" - - @classmethod - def poll(cls, context): - return tool.Blender.is_tab(context, "DRAWINGS") and tool.Ifc.get() + bl_parent_id = "BIM_PT_tab_drawings" + bl_options = {"HIDE_HEADER"} def draw(self, context): if not DrawingsData.is_loaded: @@ -245,10 +244,8 @@ class BIM_PT_schedules(Panel): bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "scene" - - @classmethod - def poll(cls, context): - return tool.Blender.is_tab(context, "DRAWINGS") and tool.Ifc.get() + bl_parent_id = "BIM_PT_tab_schedules" + bl_options = {"HIDE_HEADER"} def draw(self, context): if not DocumentsData.is_loaded: @@ -297,10 +294,8 @@ class BIM_PT_references(Panel): bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "scene" - - @classmethod - def poll(cls, context): - return tool.Blender.is_tab(context, "DRAWINGS") and tool.Ifc.get() + bl_parent_id = "BIM_PT_tab_references" + bl_options = {"HIDE_HEADER"} def draw(self, context): if not DocumentsData.is_loaded: @@ -341,10 +336,8 @@ class BIM_PT_sheets(Panel): bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "scene" - - @classmethod - def poll(cls, context): - return tool.Blender.is_tab(context, "DRAWINGS") and tool.Ifc.get() + bl_parent_id = "BIM_PT_tab_sheets" + bl_options = {"HIDE_HEADER"} def draw(self, context): if not SheetsData.is_loaded: diff --git a/src/blenderbim/blenderbim/bim/ui.py b/src/blenderbim/blenderbim/bim/ui.py index 33112cbb8f..8a5a324fff 100644 --- a/src/blenderbim/blenderbim/bim/ui.py +++ b/src/blenderbim/blenderbim/bim/ui.py @@ -629,6 +629,66 @@ class BIM_PT_tab_styles(Panel): pass +class BIM_PT_tab_sheets(Panel): + bl_label = "Sheets" + bl_space_type = "PROPERTIES" + bl_region_type = "WINDOW" + bl_context = "scene" + bl_order = 1 + + @classmethod + def poll(cls, context): + return tool.Blender.is_tab(context, "DRAWINGS") and tool.Ifc.get() + + def draw(self, context): + pass + + +class BIM_PT_tab_drawings(Panel): + bl_label = "Drawings" + bl_space_type = "PROPERTIES" + bl_region_type = "WINDOW" + bl_context = "scene" + bl_order = 1 + + @classmethod + def poll(cls, context): + return tool.Blender.is_tab(context, "DRAWINGS") and tool.Ifc.get() + + def draw(self, context): + pass + + +class BIM_PT_tab_schedules(Panel): + bl_label = "Schedules" + bl_space_type = "PROPERTIES" + bl_region_type = "WINDOW" + bl_context = "scene" + bl_order = 1 + + @classmethod + def poll(cls, context): + return tool.Blender.is_tab(context, "DRAWINGS") and tool.Ifc.get() + + def draw(self, context): + pass + + +class BIM_PT_tab_references(Panel): + bl_label = "References" + bl_space_type = "PROPERTIES" + bl_region_type = "WINDOW" + bl_context = "scene" + bl_order = 1 + + @classmethod + def poll(cls, context): + return tool.Blender.is_tab(context, "DRAWINGS") and tool.Ifc.get() + + def draw(self, context): + pass + + class BIM_PT_tab_services_object(Panel): bl_label = "Services" bl_space_type = "PROPERTIES"