diff --git a/src/blenderbim/blenderbim/bim/__init__.py b/src/blenderbim/blenderbim/bim/__init__.py index cffd22e139..761ed00193 100644 --- a/src/blenderbim/blenderbim/bim/__init__.py +++ b/src/blenderbim/blenderbim/bim/__init__.py @@ -91,7 +91,6 @@ classes = [ operator.AddIfcFile, operator.BIM_OT_add_section_plane, operator.BIM_OT_remove_section_plane, - operator.ConfigureVisibility, operator.OpenUpstream, operator.OpenUri, operator.SwitchTab, @@ -112,7 +111,6 @@ classes = [ operator.BIM_OT_enum_property_search, # /!\ Register AFTER prop.StrProperty prop.ObjProperty, prop.Attribute, - prop.ModuleVisibility, prop.BIMAreaProperties, prop.BIMProperties, prop.IfcParameter, diff --git a/src/blenderbim/blenderbim/bim/data/ui/presets.py b/src/blenderbim/blenderbim/bim/data/ui/presets.py deleted file mode 100644 index c1866f9d89..0000000000 --- a/src/blenderbim/blenderbim/bim/data/ui/presets.py +++ /dev/null @@ -1,214 +0,0 @@ -# BlenderBIM Add-on - OpenBIM Blender Add-on -# Copyright (C) 2021 Dion Moult -# -# This file is part of BlenderBIM Add-on. -# -# BlenderBIM Add-on is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# BlenderBIM Add-on is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with BlenderBIM Add-on. If not, see . - -presets = { - "Basic": ["project", "search", "bcf", "attribute", "spatial", "pset", "qto"], - "Admin": [ - "project", - "search", - "bcf", - "root", - "unit", - "model", - "georeference", - "context", - "drawing", - "misc", - "attribute", - "type", - "spatial", - "void", - "aggregate", - "geometry", - "cobie", - "resource", - "cost", - "sequence", - "group", - "system", - "structural", - "boundary", - "profile", - "material", - "style", - "layer", - "owner", - "pset", - "qto", - "classification", - "constraint", - "document", - "pset_template", - "clash", - "lca", - "csv", - "bimtester", - "diff", - "patch", - "covetool", - "augin", - "debug", - ], - "BIM Coordination": [ - "project", - "search", - "bcf", - "root", - "unit", - "georeference", - "attribute", - "type", - "spatial", - "void", - "aggregate", - "owner", - "pset", - "qto", - "clash", - "csv", - "bimtester", - "diff", - "patch", - "debug", - ], - "Architecture": [ - "project", - "search", - "bcf", - "root", - "unit", - "model", - "georeference", - "context", - "drawing", - "misc", - "attribute", - "type", - "spatial", - "void", - "aggregate", - "geometry", - "group", - "system", - "boundary", - "profile", - "material", - "style", - "layer", - "owner", - "pset", - "qto", - "classification", - "pset_template", - "clash", - "csv", - ], - "Structural Engineering": [ - "project", - "search", - "bcf", - "root", - "unit", - "model", - "georeference", - "context", - "drawing", - "misc", - "attribute", - "type", - "spatial", - "void", - "aggregate", - "geometry", - "group", - "system", - "structural", - "boundary", - "profile", - "material", - "style", - "layer", - "owner", - "pset", - "qto", - "classification", - "pset_template", - "clash", - "csv", - ], - "MEP": [ - "project", - "search", - "bcf", - "root", - "unit", - "model", - "georeference", - "context", - "drawing", - "misc", - "attribute", - "type", - "spatial", - "void", - "aggregate", - "geometry", - "group", - "system", - "boundary", - "profile", - "material", - "style", - "layer", - "owner", - "pset", - "qto", - "classification", - "pset_template", - "clash", - "csv", - ], - "Quantity Surveying": ["project", "search", "attribute", "spatial", "void", "pset", "qto", "classification", "csv"], - "Model Enrichment": [ - "project", - "search", - "root", - "attribute", - "spatial", - "pset", - "qto", - "pset_template", - "csv", - "patch", - ], - "3D Visualisation": ["project", "search", "bcf", "attribute", "spatial", "pset", "qto"], - "4D Scheduling": ["project", "search", "attribute", "spatial", "resource", "cost", "sequence", "pset", "qto"], - "5D Cost Management": [ - "project", - "search", - "attribute", - "spatial", - "resource", - "cost", - "sequence", - "pset", - "qto", - "lca", - ], - "Facility Management": ["project", "search", "attribute", "spatial", "cobie", "pset", "qto", "lca"], -} diff --git a/src/blenderbim/blenderbim/bim/operator.py b/src/blenderbim/blenderbim/bim/operator.py index 2e8396c14c..36628cc2cd 100644 --- a/src/blenderbim/blenderbim/bim/operator.py +++ b/src/blenderbim/blenderbim/bim/operator.py @@ -766,41 +766,6 @@ class FetchObjectPassport(bpy.types.Operator): context.active_object.data = bpy.data.meshes[reference.name] -class ConfigureVisibility(bpy.types.Operator): - bl_idname = "bim.configure_visibility" - bl_label = "Configure module UI visibility in BlenderBIM" - bl_options = {"REGISTER", "UNDO"} - - def invoke(self, context, event): - from blenderbim.bim import modules - - wm = context.window_manager - if not len(context.scene.BIMProperties.module_visibility): - for module in sorted(modules.keys()): - new = context.scene.BIMProperties.module_visibility.add() - new.name = module - return wm.invoke_props_dialog(self, width=450) - - def draw(self, context): - layout = self.layout - - layout.prop(context.scene.BIMProperties, "ui_preset") - layout.separator() - layout.label(text="Adjust the modules to your liking:") - - grid = layout.column_flow(columns=3) - for module in context.scene.BIMProperties.module_visibility: - split = grid.split() - col = split.column() - col.label(text=module.name.capitalize()) - - col = split.column() - col.prop(module, "is_visible", text="") - - def execute(self, context): - return {"FINISHED"} - - def update_enum_property_search_prop(self, context): for i, prop in enumerate(self.collection_names): if prop.name == self.dummy_name: diff --git a/src/blenderbim/blenderbim/bim/prop.py b/src/blenderbim/blenderbim/bim/prop.py index 985135e705..209107a6b2 100644 --- a/src/blenderbim/blenderbim/bim/prop.py +++ b/src/blenderbim/blenderbim/bim/prop.py @@ -58,45 +58,6 @@ def update_tab(self, context): self.previous_tab = self.tab -def update_preset(self, context): - from blenderbim.bim.data.ui.presets import presets - - module_visibility = context.scene.BIMProperties.module_visibility - chosen_preset = context.scene.BIMProperties.ui_preset - - for module in module_visibility: - module.is_visible = module.name in presets[chosen_preset] - - -def load_presets(self, context): - from blenderbim.bim.data.ui.presets import presets - - return [(preset, preset, "") for preset in presets.keys()] - - -def update_is_visible(self, context): - from blenderbim.bim import modules - - # TODO: Pset depends on sequence module as an edge case. - if self.name == "sequence" and not self.is_visible: - context.scene.BIMProperties.module_visibility["pset"].is_visible = False - - for cls in modules[self.name].classes: - if not issubclass(cls, bpy.types.Panel): - continue - - if self.is_visible: - try: - bpy.utils.register_class(cls) - except: - pass - else: - try: - bpy.utils.unregister_class(cls) - except: - pass - - # If we don't cache strings, accents get mangled due to a Blender bug # https://blender.stackexchange.com/questions/216230/is-there-a-workaround-for-the-known-bug-in-dynamic-enumproperty # https://github.com/IfcOpenShell/IfcOpenShell/pull/1945 @@ -336,11 +297,6 @@ class Attribute(PropertyGroup): setattr(self, self.get_value_name(), value) -class ModuleVisibility(PropertyGroup): - name: StringProperty(name="Name") - is_visible: BoolProperty(name="Value", default=True, update=update_is_visible) - - def get_tab(self, context): return [ ("PROJECT", "Project Overview", "", blenderbim.bim.icons["IFC"].icon_id, 0), @@ -365,13 +321,6 @@ class BIMAreaProperties(PropertyGroup): class BIMProperties(PropertyGroup): - ui_preset: EnumProperty( - name="UI Preset", - description="Select from one of the available UI presets, or configure the modules to your preference below", - update=update_preset, - items=load_presets, - ) - module_visibility: CollectionProperty(name="Module Visibility", type=ModuleVisibility) schema_dir: StringProperty( default=os.path.join(cwd, "schema") + os.path.sep, name="Schema Directory", update=update_schema_dir ) diff --git a/src/blenderbim/blenderbim/bim/ui.py b/src/blenderbim/blenderbim/bim/ui.py index a4af1ad7ac..12cccdfee7 100644 --- a/src/blenderbim/blenderbim/bim/ui.py +++ b/src/blenderbim/blenderbim/bim/ui.py @@ -267,9 +267,6 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences): row = self.layout.row(align=True) row.prop(context.scene.DocProperties, "shadingstyle_default") - row = layout.row() - row.operator("bim.configure_visibility") - # Scene panel groups class BIM_PT_tabs(Panel):