Drawing panels now moved to the drawings and documents "tab"

This commit is contained in:
Dion Moult
2023-07-09 18:30:40 +10:00
parent 9b1693e112
commit 45cf6a8ace
4 changed files with 24 additions and 39 deletions
@@ -170,7 +170,6 @@ def register():
bpy.types.Curve.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
bpy.types.Camera.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
bpy.types.PointLight.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
bpy.types.SCENE_PT_unit.append(ui.ifc_units)
if hasattr(bpy.types, "UI_MT_button_context_menu"):
bpy.types.UI_MT_button_context_menu.append(ui.draw_custom_context_menu)
bpy.types.STATUSBAR_HT_header.append(ui.draw_statusbar)
@@ -198,7 +197,6 @@ def unregister():
del bpy.types.Curve.BIMMeshProperties
del bpy.types.Camera.BIMMeshProperties
del bpy.types.PointLight.BIMMeshProperties
bpy.types.SCENE_PT_unit.remove(ui.ifc_units)
if hasattr(bpy.types, "UI_MT_button_context_menu"):
bpy.types.UI_MT_button_context_menu.remove(ui.draw_custom_context_menu)
bpy.types.STATUSBAR_HT_header.remove(ui.draw_statusbar)
@@ -161,13 +161,14 @@ class BIM_PT_drawing_underlay(Panel):
class BIM_PT_drawings(Panel):
bl_label = "Drawings"
bl_idname = "BIM_PT_drawings"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "BIM Documentation"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "scene"
@classmethod
def poll(cls, context):
return tool.Ifc.get()
aprops = context.screen.BIMAreaProperties[context.screen.areas[:].index(context.area)]
return aprops.tab == "DRAWINGS" and tool.Ifc.get()
def draw(self, context):
if not DrawingsData.is_loaded:
@@ -229,13 +230,14 @@ class BIM_PT_drawings(Panel):
class BIM_PT_schedules(Panel):
bl_label = "Schedules"
bl_idname = "BIM_PT_schedules"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "BIM Documentation"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "scene"
@classmethod
def poll(cls, context):
return tool.Ifc.get()
aprops = context.screen.BIMAreaProperties[context.screen.areas[:].index(context.area)]
return aprops.tab == "DRAWINGS" and tool.Ifc.get()
def draw(self, context):
if not DocumentsData.is_loaded:
@@ -284,13 +286,14 @@ def draw_project_not_saved_ui(self):
class BIM_PT_references(Panel):
bl_label = "References"
bl_idname = "BIM_PT_references"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "BIM Documentation"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "scene"
@classmethod
def poll(cls, context):
return tool.Ifc.get()
aprops = context.screen.BIMAreaProperties[context.screen.areas[:].index(context.area)]
return aprops.tab == "DRAWINGS" and tool.Ifc.get()
def draw(self, context):
if not DocumentsData.is_loaded:
@@ -328,13 +331,14 @@ class BIM_PT_references(Panel):
class BIM_PT_sheets(Panel):
bl_label = "Sheets"
bl_idname = "BIM_PT_sheets"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "BIM Documentation"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "scene"
@classmethod
def poll(cls, context):
return tool.Ifc.get()
aprops = context.screen.BIMAreaProperties[context.screen.areas[:].index(context.area)]
return aprops.tab == "DRAWINGS" and tool.Ifc.get()
def draw(self, context):
if not SheetsData.is_loaded:
-12
View File
@@ -268,18 +268,6 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
row.operator("bim.configure_visibility")
def ifc_units(self, context):
scene = context.scene
props = scene.BIMProperties
layout = self.layout
layout.use_property_decorate = False
layout.use_property_split = True
row = layout.row()
row.prop(props, "area_unit")
row = layout.row()
row.prop(props, "volume_unit")
# Scene panel groups
class BIM_PT_root(Panel):
bl_label = "BlenderBIM Add-on"
+4 -9
View File
@@ -1493,19 +1493,14 @@ class Drawing(blenderbim.core.tool.Drawing):
# Sync viewport objects visibility with selectors from EPset_Drawing/Include and /Exclude
drawing = tool.Ifc.get_entity(camera)
# Running operators is much more efficient in this scenario than looping through each element
if not bpy.app.background:
bpy.ops.object.hide_view_clear()
filtered_elements = cls.get_drawing_elements(drawing) | cls.get_drawing_spaces(drawing)
for visible_obj in bpy.context.visible_objects:
element = tool.Ifc.get_entity(visible_obj)
for view_layer_object in bpy.context.view_layer.objects:
element = tool.Ifc.get_entity(view_layer_object)
if not element:
continue
hide = element not in filtered_elements
if bpy.context.view_layer.objects.get(visible_obj.name):
visible_obj.hide_set(hide)
visible_obj.hide_render = hide
view_layer_object.hide_set(hide)
view_layer_object.hide_render = hide
subcontexts = []
target_view = cls.get_drawing_target_view(drawing)