mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 09:48:41 +00:00
Drawing panels now moved to the drawings and documents "tab"
This commit is contained in:
@@ -170,7 +170,6 @@ def register():
|
|||||||
bpy.types.Curve.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
|
bpy.types.Curve.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
|
||||||
bpy.types.Camera.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.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"):
|
if hasattr(bpy.types, "UI_MT_button_context_menu"):
|
||||||
bpy.types.UI_MT_button_context_menu.append(ui.draw_custom_context_menu)
|
bpy.types.UI_MT_button_context_menu.append(ui.draw_custom_context_menu)
|
||||||
bpy.types.STATUSBAR_HT_header.append(ui.draw_statusbar)
|
bpy.types.STATUSBAR_HT_header.append(ui.draw_statusbar)
|
||||||
@@ -198,7 +197,6 @@ def unregister():
|
|||||||
del bpy.types.Curve.BIMMeshProperties
|
del bpy.types.Curve.BIMMeshProperties
|
||||||
del bpy.types.Camera.BIMMeshProperties
|
del bpy.types.Camera.BIMMeshProperties
|
||||||
del bpy.types.PointLight.BIMMeshProperties
|
del bpy.types.PointLight.BIMMeshProperties
|
||||||
bpy.types.SCENE_PT_unit.remove(ui.ifc_units)
|
|
||||||
if hasattr(bpy.types, "UI_MT_button_context_menu"):
|
if hasattr(bpy.types, "UI_MT_button_context_menu"):
|
||||||
bpy.types.UI_MT_button_context_menu.remove(ui.draw_custom_context_menu)
|
bpy.types.UI_MT_button_context_menu.remove(ui.draw_custom_context_menu)
|
||||||
bpy.types.STATUSBAR_HT_header.remove(ui.draw_statusbar)
|
bpy.types.STATUSBAR_HT_header.remove(ui.draw_statusbar)
|
||||||
|
|||||||
@@ -161,13 +161,14 @@ class BIM_PT_drawing_underlay(Panel):
|
|||||||
class BIM_PT_drawings(Panel):
|
class BIM_PT_drawings(Panel):
|
||||||
bl_label = "Drawings"
|
bl_label = "Drawings"
|
||||||
bl_idname = "BIM_PT_drawings"
|
bl_idname = "BIM_PT_drawings"
|
||||||
bl_space_type = "VIEW_3D"
|
bl_space_type = "PROPERTIES"
|
||||||
bl_region_type = "UI"
|
bl_region_type = "WINDOW"
|
||||||
bl_category = "BIM Documentation"
|
bl_context = "scene"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
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):
|
def draw(self, context):
|
||||||
if not DrawingsData.is_loaded:
|
if not DrawingsData.is_loaded:
|
||||||
@@ -229,13 +230,14 @@ class BIM_PT_drawings(Panel):
|
|||||||
class BIM_PT_schedules(Panel):
|
class BIM_PT_schedules(Panel):
|
||||||
bl_label = "Schedules"
|
bl_label = "Schedules"
|
||||||
bl_idname = "BIM_PT_schedules"
|
bl_idname = "BIM_PT_schedules"
|
||||||
bl_space_type = "VIEW_3D"
|
bl_space_type = "PROPERTIES"
|
||||||
bl_region_type = "UI"
|
bl_region_type = "WINDOW"
|
||||||
bl_category = "BIM Documentation"
|
bl_context = "scene"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
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):
|
def draw(self, context):
|
||||||
if not DocumentsData.is_loaded:
|
if not DocumentsData.is_loaded:
|
||||||
@@ -284,13 +286,14 @@ def draw_project_not_saved_ui(self):
|
|||||||
class BIM_PT_references(Panel):
|
class BIM_PT_references(Panel):
|
||||||
bl_label = "References"
|
bl_label = "References"
|
||||||
bl_idname = "BIM_PT_references"
|
bl_idname = "BIM_PT_references"
|
||||||
bl_space_type = "VIEW_3D"
|
bl_space_type = "PROPERTIES"
|
||||||
bl_region_type = "UI"
|
bl_region_type = "WINDOW"
|
||||||
bl_category = "BIM Documentation"
|
bl_context = "scene"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
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):
|
def draw(self, context):
|
||||||
if not DocumentsData.is_loaded:
|
if not DocumentsData.is_loaded:
|
||||||
@@ -328,13 +331,14 @@ class BIM_PT_references(Panel):
|
|||||||
class BIM_PT_sheets(Panel):
|
class BIM_PT_sheets(Panel):
|
||||||
bl_label = "Sheets"
|
bl_label = "Sheets"
|
||||||
bl_idname = "BIM_PT_sheets"
|
bl_idname = "BIM_PT_sheets"
|
||||||
bl_space_type = "VIEW_3D"
|
bl_space_type = "PROPERTIES"
|
||||||
bl_region_type = "UI"
|
bl_region_type = "WINDOW"
|
||||||
bl_category = "BIM Documentation"
|
bl_context = "scene"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
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):
|
def draw(self, context):
|
||||||
if not SheetsData.is_loaded:
|
if not SheetsData.is_loaded:
|
||||||
|
|||||||
@@ -268,18 +268,6 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
|
|||||||
row.operator("bim.configure_visibility")
|
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
|
# Scene panel groups
|
||||||
class BIM_PT_root(Panel):
|
class BIM_PT_root(Panel):
|
||||||
bl_label = "BlenderBIM Add-on"
|
bl_label = "BlenderBIM Add-on"
|
||||||
|
|||||||
@@ -1493,19 +1493,14 @@ class Drawing(blenderbim.core.tool.Drawing):
|
|||||||
# Sync viewport objects visibility with selectors from EPset_Drawing/Include and /Exclude
|
# Sync viewport objects visibility with selectors from EPset_Drawing/Include and /Exclude
|
||||||
drawing = tool.Ifc.get_entity(camera)
|
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)
|
filtered_elements = cls.get_drawing_elements(drawing) | cls.get_drawing_spaces(drawing)
|
||||||
for visible_obj in bpy.context.visible_objects:
|
for view_layer_object in bpy.context.view_layer.objects:
|
||||||
element = tool.Ifc.get_entity(visible_obj)
|
element = tool.Ifc.get_entity(view_layer_object)
|
||||||
if not element:
|
if not element:
|
||||||
continue
|
continue
|
||||||
hide = element not in filtered_elements
|
hide = element not in filtered_elements
|
||||||
if bpy.context.view_layer.objects.get(visible_obj.name):
|
view_layer_object.hide_set(hide)
|
||||||
visible_obj.hide_set(hide)
|
view_layer_object.hide_render = hide
|
||||||
visible_obj.hide_render = hide
|
|
||||||
|
|
||||||
subcontexts = []
|
subcontexts = []
|
||||||
target_view = cls.get_drawing_target_view(drawing)
|
target_view = cls.get_drawing_target_view(drawing)
|
||||||
|
|||||||
Reference in New Issue
Block a user