mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Reorganise new stakeholders panel, move profiles into geometry tab. General UI polish.
This commit is contained in:
@@ -125,13 +125,14 @@ classes = [
|
||||
ui.BIM_UL_generic,
|
||||
ui.BIM_UL_topics,
|
||||
ui.BIM_ADDON_preferences,
|
||||
# Project overview
|
||||
ui.BIM_PT_project_info,
|
||||
ui.BIM_PT_project_setup,
|
||||
ui.BIM_PT_geometry,
|
||||
ui.BIM_PT_tab_grouping_and_filtering,
|
||||
# Tabs panel
|
||||
ui.BIM_PT_tabs,
|
||||
# Project overview
|
||||
ui.BIM_PT_tab_project_info,
|
||||
ui.BIM_PT_tab_project_setup,
|
||||
ui.BIM_PT_tab_geometry,
|
||||
ui.BIM_PT_tab_stakeholders,
|
||||
ui.BIM_PT_tab_grouping_and_filtering,
|
||||
# Object information
|
||||
ui.BIM_PT_tab_object_metadata,
|
||||
ui.BIM_PT_tab_misc,
|
||||
@@ -140,6 +141,7 @@ classes = [
|
||||
ui.BIM_PT_tab_representations,
|
||||
ui.BIM_PT_tab_geometric_relationships,
|
||||
ui.BIM_PT_tab_parametric_geometry,
|
||||
ui.BIM_PT_tab_profiles,
|
||||
ui.BIM_PT_tab_materials,
|
||||
ui.BIM_PT_tab_styles,
|
||||
# Drawings and documents
|
||||
|
||||
@@ -31,7 +31,7 @@ class BIM_PT_SceneBoundaries(Panel):
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_parent_id = "BIM_PT_geometry"
|
||||
bl_parent_id = "BIM_PT_tab_geometry"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
|
||||
@@ -28,7 +28,7 @@ class BIM_PT_bsdd(Panel):
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_parent_id = "BIM_PT_project_setup"
|
||||
bl_parent_id = "BIM_PT_tab_project_setup"
|
||||
|
||||
def draw(self, context):
|
||||
props = context.scene.BIMBSDDProperties
|
||||
|
||||
@@ -36,7 +36,7 @@ class BIM_PT_classifications(Panel):
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_parent_id = "BIM_PT_project_setup"
|
||||
bl_parent_id = "BIM_PT_tab_project_setup"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
|
||||
@@ -29,7 +29,7 @@ class BIM_PT_constraints(Panel):
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_parent_id = "BIM_PT_project_setup"
|
||||
bl_parent_id = "BIM_PT_tab_project_setup"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
|
||||
@@ -29,7 +29,7 @@ class BIM_PT_context(bpy.types.Panel):
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_parent_id = "BIM_PT_geometry"
|
||||
bl_parent_id = "BIM_PT_tab_geometry"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
|
||||
@@ -29,7 +29,7 @@ class BIM_PT_documents(Panel):
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_parent_id = "BIM_PT_project_setup"
|
||||
bl_parent_id = "BIM_PT_tab_project_setup"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
|
||||
@@ -29,7 +29,7 @@ class BIM_PT_gis(Panel):
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_parent_id = "BIM_PT_geometry"
|
||||
bl_parent_id = "BIM_PT_tab_geometry"
|
||||
|
||||
def draw(self, context):
|
||||
self.layout.use_property_split = True
|
||||
|
||||
@@ -11,7 +11,7 @@ class IFCGIT_PT_panel(bpy.types.Panel):
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_options = {"DEFAULT_CLOSED"}
|
||||
bl_parent_id = "BIM_PT_project_info"
|
||||
bl_parent_id = "BIM_PT_tab_project_info"
|
||||
|
||||
def draw(self, context):
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class BIM_PT_libraries(Panel):
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_parent_id = "BIM_PT_project_setup"
|
||||
bl_parent_id = "BIM_PT_tab_project_setup"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
|
||||
@@ -63,13 +63,19 @@ class BIM_PT_materials(Panel):
|
||||
material = self.props.materials[self.props.active_material_index]
|
||||
if material.ifc_definition_id:
|
||||
if self.props.active_material_id:
|
||||
row.operator("bim.edit_material", text="", icon="CHECKMARK").material = material.ifc_definition_id
|
||||
row.operator("bim.disable_editing_material", text="", icon="CANCEL").material = material.ifc_definition_id
|
||||
row.operator(
|
||||
"bim.edit_material", text="", icon="CHECKMARK"
|
||||
).material = material.ifc_definition_id
|
||||
row.operator(
|
||||
"bim.disable_editing_material", text="", icon="CANCEL"
|
||||
).material = material.ifc_definition_id
|
||||
self.draw_editable_material_attributes_ui()
|
||||
else:
|
||||
op = row.operator("bim.select_by_material", text="", icon="RESTRICT_SELECT_OFF")
|
||||
op.material = material.ifc_definition_id
|
||||
row.operator("bim.enable_editing_material", text="", icon="GREASEPENCIL").material = material.ifc_definition_id
|
||||
row.operator(
|
||||
"bim.enable_editing_material", text="", icon="GREASEPENCIL"
|
||||
).material = material.ifc_definition_id
|
||||
row.operator("bim.remove_material", text="", icon="X").material = material.ifc_definition_id
|
||||
else:
|
||||
row.operator("bim.add_material_set", text="", icon="ADD").set_type = self.props.material_type
|
||||
@@ -82,10 +88,10 @@ class BIM_PT_materials(Panel):
|
||||
|
||||
self.layout.template_list("BIM_UL_materials", "", self.props, "materials", self.props, "active_material_index")
|
||||
|
||||
|
||||
def draw_editable_material_attributes_ui(self):
|
||||
blenderbim.bim.helper.draw_attributes(self.props.material_attributes, self.layout)
|
||||
|
||||
|
||||
class BIM_PT_material(Panel):
|
||||
bl_label = "Material"
|
||||
bl_idname = "BIM_PT_material"
|
||||
@@ -219,9 +225,7 @@ class BIM_PT_object_material(Panel):
|
||||
elif self.props.active_material_set_item_id == set_item["id"]:
|
||||
self.draw_editable_set_item_ui(set_item)
|
||||
else:
|
||||
self.draw_read_only_set_item_ui(
|
||||
set_item, index, is_first=index == 0, is_last=index == total_items - 1
|
||||
)
|
||||
self.draw_read_only_set_item_ui(set_item, index, is_first=index == 0, is_last=index == total_items - 1)
|
||||
|
||||
def draw_editable_set_item_profile_ui(self, set_item):
|
||||
box = self.layout.box()
|
||||
@@ -267,7 +271,10 @@ class BIM_PT_object_material(Panel):
|
||||
op.old_index = index
|
||||
op.new_index = index + 1
|
||||
setattr(op, "material_set", ObjectMaterialData.data["set"]["id"])
|
||||
if not self.props.active_material_set_item_id and ObjectMaterialData.data["material_class"] != "IfcMaterialList":
|
||||
if (
|
||||
not self.props.active_material_set_item_id
|
||||
and ObjectMaterialData.data["material_class"] != "IfcMaterialList"
|
||||
):
|
||||
if "Profile" in ObjectMaterialData.data["material_class"]:
|
||||
op = row.operator("bim.enable_editing_material_set_item_profile", icon="ITALIC", text="")
|
||||
op.material_set_item = set_item["id"]
|
||||
|
||||
@@ -160,7 +160,7 @@ class BIM_PT_Grids(Panel):
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_parent_id = "BIM_PT_project_setup"
|
||||
bl_parent_id = "BIM_PT_tab_project_setup"
|
||||
|
||||
def draw(self, context):
|
||||
self.layout.row().operator("mesh.add_grid", icon="ADD", text="Add Grids")
|
||||
|
||||
@@ -83,7 +83,7 @@ class BIM_PT_people(bpy.types.Panel):
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_parent_id = "BIM_PT_project_setup"
|
||||
bl_parent_id = "BIM_PT_tab_stakeholders"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
@@ -142,7 +142,7 @@ class BIM_PT_organisations(bpy.types.Panel):
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_parent_id = "BIM_PT_project_setup"
|
||||
bl_parent_id = "BIM_PT_tab_stakeholders"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
@@ -189,7 +189,7 @@ class BIM_PT_owner(bpy.types.Panel):
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_parent_id = "BIM_PT_project_setup"
|
||||
bl_parent_id = "BIM_PT_tab_stakeholders"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
@@ -240,7 +240,7 @@ class BIM_PT_actor(bpy.types.Panel):
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_parent_id = "BIM_PT_project_setup"
|
||||
bl_parent_id = "BIM_PT_tab_stakeholders"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
|
||||
@@ -27,11 +27,11 @@ from blenderbim.bim.module.profile.prop import generate_thumbnail_for_active_pro
|
||||
class BIM_PT_profiles(Panel):
|
||||
bl_label = "Profiles"
|
||||
bl_idname = "BIM_PT_profiles"
|
||||
bl_options = {"DEFAULT_CLOSED"}
|
||||
bl_options = {"HIDE_HEADER"}
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_parent_id = "BIM_PT_geometry"
|
||||
bl_parent_id = "BIM_PT_tab_profiles"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
@@ -58,11 +58,11 @@ class BIM_PT_profiles(Panel):
|
||||
box.template_icon(icon_value=preview_image.icon_id, scale=5)
|
||||
|
||||
row = self.layout.row(align=True)
|
||||
row.label(text=f"{ProfileData.data['total_profiles']} Named Profiles Found", icon="SNAP_GRID")
|
||||
row.label(text=f"{ProfileData.data['total_profiles']} Named Profiles", icon="ITALIC")
|
||||
if self.props.is_editing:
|
||||
row.operator("bim.disable_profile_editing_ui", text="", icon="CANCEL")
|
||||
else:
|
||||
row.operator("bim.load_profiles", text="", icon="GREASEPENCIL")
|
||||
row.operator("bim.load_profiles", text="", icon="IMPORT")
|
||||
|
||||
if not self.props.is_editing:
|
||||
return
|
||||
|
||||
@@ -84,7 +84,7 @@ class BIM_PT_project(Panel):
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_options = {"HIDE_HEADER"}
|
||||
bl_parent_id = "BIM_PT_project_info"
|
||||
bl_parent_id = "BIM_PT_tab_project_info"
|
||||
|
||||
def draw(self, context):
|
||||
if not ProjectData.is_loaded:
|
||||
@@ -244,7 +244,7 @@ class BIM_PT_project_library(Panel):
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_parent_id = "BIM_PT_project_setup"
|
||||
bl_parent_id = "BIM_PT_tab_project_setup"
|
||||
|
||||
def draw(self, context):
|
||||
self.layout.use_property_decorate = False
|
||||
@@ -287,7 +287,7 @@ class BIM_PT_links(Panel):
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_parent_id = "BIM_PT_project_setup"
|
||||
bl_parent_id = "BIM_PT_tab_project_setup"
|
||||
|
||||
def draw(self, context):
|
||||
self.props = context.scene.BIMProjectProperties
|
||||
|
||||
@@ -29,7 +29,7 @@ class BIM_PT_pset_template(Panel):
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_parent_id = "BIM_PT_project_setup"
|
||||
bl_parent_id = "BIM_PT_tab_project_setup"
|
||||
|
||||
def draw(self, context):
|
||||
if not PsetTemplatesData.is_loaded:
|
||||
|
||||
@@ -103,7 +103,7 @@ class BIM_PT_SpatialManager(Panel):
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_options = {"DEFAULT_CLOSED"}
|
||||
bl_parent_id = "BIM_PT_project_setup"
|
||||
bl_parent_id = "BIM_PT_tab_project_setup"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
|
||||
@@ -25,14 +25,14 @@ classes = (
|
||||
operator.AddStyle,
|
||||
operator.BrowseExternalStyle,
|
||||
operator.ClearTextureMapPath,
|
||||
operator.DisableAddPresentationStyle,
|
||||
operator.DisableAddingPresentationStyle,
|
||||
operator.DisableEditingExternalStyle,
|
||||
operator.DisableEditingStyle,
|
||||
operator.DisableEditingStyles,
|
||||
operator.EditExternalStyle,
|
||||
operator.EditStyle,
|
||||
operator.EditSurfaceStyle,
|
||||
operator.EnableAddPresentationStyle,
|
||||
operator.EnableAddingPresentationStyle,
|
||||
operator.EnableEditingExternalStyle,
|
||||
operator.EnableEditingStyle,
|
||||
operator.EnableEditingSurfaceStyle,
|
||||
|
||||
@@ -431,8 +431,8 @@ class ClearTextureMapPath(bpy.types.Operator):
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class EnableAddPresentationStyle(bpy.types.Operator, tool.Ifc.Operator):
|
||||
bl_idname = "bim.enable_add_presentation_style"
|
||||
class EnableAddingPresentationStyle(bpy.types.Operator, tool.Ifc.Operator):
|
||||
bl_idname = "bim.enable_adding_presentation_style"
|
||||
bl_label = "Enable Add Presentation Style"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
||||
@@ -441,8 +441,8 @@ class EnableAddPresentationStyle(bpy.types.Operator, tool.Ifc.Operator):
|
||||
props.is_adding = True
|
||||
|
||||
|
||||
class DisableAddPresentationStyle(bpy.types.Operator, tool.Ifc.Operator):
|
||||
bl_idname = "bim.disable_add_presentation_style"
|
||||
class DisableAddingPresentationStyle(bpy.types.Operator, tool.Ifc.Operator):
|
||||
bl_idname = "bim.disable_adding_presentation_style"
|
||||
bl_label = "Disable Add Presentation Style"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class BIM_PT_styles(Panel):
|
||||
row = self.layout.row(align=True)
|
||||
row.label(text="{} {}s".format(len(self.props.styles), self.props.style_type), icon="SHADING_RENDERED")
|
||||
if not self.props.is_adding:
|
||||
row.operator("bim.enable_add_presentation_style", text="", icon="ADD")
|
||||
row.operator("bim.enable_adding_presentation_style", text="", icon="ADD")
|
||||
row.operator("bim.disable_editing_styles", text="", icon="CANCEL")
|
||||
else:
|
||||
row = self.layout.row(align=True)
|
||||
@@ -69,7 +69,7 @@ class BIM_PT_styles(Panel):
|
||||
row.prop(self.props, "surface_colour", text="Colour")
|
||||
row = box.row(align=True)
|
||||
row.operator("bim.add_presentation_style", text="Save New Style", icon="CHECKMARK")
|
||||
row.operator("bim.disable_add_presentation_style", text="", icon="CANCEL")
|
||||
row.operator("bim.disable_adding_presentation_style", text="", icon="CANCEL")
|
||||
|
||||
if self.props.styles and self.props.active_style_index < len(self.props.styles):
|
||||
row = self.layout.row(align=True)
|
||||
|
||||
@@ -97,7 +97,7 @@ class BIM_PT_systems(Panel):
|
||||
prop_with_search(row, self.props, "system_class", text="")
|
||||
row.operator("bim.add_system", text="", icon="ADD")
|
||||
else:
|
||||
row.operator("bim.load_systems", text="", icon="GREASEPENCIL")
|
||||
row.operator("bim.load_systems", text="", icon="IMPORT")
|
||||
|
||||
if self.props.is_editing:
|
||||
self.layout.template_list(
|
||||
@@ -293,7 +293,7 @@ class BIM_PT_zones(Panel):
|
||||
row = self.layout.row(align=True)
|
||||
row.label(text="{} Zones Found".format(ZonesData.data["total_zones"]), icon="SEQ_STRIP_META")
|
||||
if not self.props.is_loaded:
|
||||
row.operator("bim.load_zones", text="", icon="GREASEPENCIL")
|
||||
row.operator("bim.load_zones", text="", icon="IMPORT")
|
||||
return
|
||||
|
||||
row.operator("bim.add_zone", text="", icon="ADD")
|
||||
|
||||
@@ -30,7 +30,7 @@ class BIM_PT_units(Panel):
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_parent_id = "BIM_PT_project_setup"
|
||||
bl_parent_id = "BIM_PT_tab_geometry"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
|
||||
@@ -339,7 +339,7 @@ class BIM_PT_tabs(Panel):
|
||||
tab_entry.enabled = enabled
|
||||
|
||||
|
||||
class BIM_PT_project_info(Panel):
|
||||
class BIM_PT_tab_project_info(Panel):
|
||||
bl_label = "Project Info"
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
@@ -353,16 +353,30 @@ class BIM_PT_project_info(Panel):
|
||||
pass
|
||||
|
||||
|
||||
class BIM_PT_project_setup(Panel):
|
||||
class BIM_PT_tab_project_setup(Panel):
|
||||
bl_label = "Project Setup"
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return tool.Blender.is_tab(context, "PROJECT")
|
||||
|
||||
def draw(self, context):
|
||||
pass
|
||||
|
||||
|
||||
class BIM_PT_tab_stakeholders(Panel):
|
||||
bl_label = "Stakeholders"
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "scene"
|
||||
bl_options = {"DEFAULT_CLOSED"}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return tool.Blender.is_tab(context, "PROJECT")
|
||||
return tool.Blender.is_tab(context, "PROJECT") and tool.Ifc.get()
|
||||
|
||||
def draw(self, context):
|
||||
pass
|
||||
@@ -397,7 +411,7 @@ class BIM_PT_tab_grouping_and_filtering(Panel):
|
||||
pass
|
||||
|
||||
|
||||
class BIM_PT_geometry(Panel):
|
||||
class BIM_PT_tab_geometry(Panel):
|
||||
bl_label = "Geometry"
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
@@ -661,6 +675,21 @@ class BIM_PT_tab_styles(Panel):
|
||||
pass
|
||||
|
||||
|
||||
class BIM_PT_tab_profiles(Panel):
|
||||
bl_label = "Profiles"
|
||||
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, "GEOMETRY") and tool.Ifc.get()
|
||||
|
||||
def draw(self, context):
|
||||
pass
|
||||
|
||||
|
||||
class BIM_PT_tab_sheets(Panel):
|
||||
bl_label = "Sheets"
|
||||
bl_space_type = "PROPERTIES"
|
||||
|
||||
Reference in New Issue
Block a user