diff --git a/src/blenderbim/blenderbim/bim/module/project/__init__.py b/src/blenderbim/blenderbim/bim/module/project/__init__.py index 1e63507dd1..a2929523cd 100644 --- a/src/blenderbim/blenderbim/bim/module/project/__init__.py +++ b/src/blenderbim/blenderbim/bim/module/project/__init__.py @@ -20,28 +20,29 @@ import bpy from . import ui, prop, operator classes = ( - operator.CreateProject, - operator.LoadProject, - operator.UnloadProject, - operator.LoadProjectElements, - operator.LinkIfc, - operator.UnlinkIfc, - operator.UnloadLink, - operator.LoadLink, - operator.ToggleLinkVisibility, - operator.SelectLibraryFile, - operator.ChangeLibraryElement, - operator.RefreshLibrary, - operator.RewindLibrary, - operator.AssignLibraryDeclaration, - operator.UnassignLibraryDeclaration, - operator.SaveLibraryFile, operator.AppendLibraryElement, - operator.EnableEditingHeader, + operator.AssignLibraryDeclaration, + operator.ChangeLibraryElement, + operator.CreateProject, operator.DisableEditingHeader, operator.EditHeader, + operator.EnableEditingHeader, operator.ExportIFC, operator.ImportIFC, + operator.LinkIfc, + operator.LoadLink, + operator.LoadProject, + operator.LoadProjectElements, + operator.RefreshLibrary, + operator.RewindLibrary, + operator.SaveLibraryFile, + operator.SelectLibraryFile, + operator.ToggleFilterCategories, + operator.ToggleLinkVisibility, + operator.UnassignLibraryDeclaration, + operator.UnlinkIfc, + operator.UnloadLink, + operator.UnloadProject, prop.LibraryElement, prop.FilterCategory, prop.Link, diff --git a/src/blenderbim/blenderbim/bim/module/project/operator.py b/src/blenderbim/blenderbim/bim/module/project/operator.py index 17ddfdc7bc..ae6f914c66 100644 --- a/src/blenderbim/blenderbim/bim/module/project/operator.py +++ b/src/blenderbim/blenderbim/bim/module/project/operator.py @@ -604,6 +604,18 @@ class LoadProjectElements(bpy.types.Operator): return set(self.file.by_type("IfcElement")) - set(selector.parse(self.file, self.props.filter_query)) +class ToggleFilterCategories(bpy.types.Operator): + bl_idname = "bim.toggle_filter_categories" + bl_label = "Toggle Filter Categories" + bl_options = {"REGISTER", "UNDO"} + should_select: bpy.props.BoolProperty(name="Should Select", default=True) + + def execute(self, context): + for filter_category in context.scene.BIMProjectProperties.filter_categories: + filter_category.is_selected = self.should_select + return {"FINISHED"} + + class LinkIfc(bpy.types.Operator): bl_idname = "bim.link_ifc" bl_label = "Link IFC" diff --git a/src/blenderbim/blenderbim/bim/module/project/ui.py b/src/blenderbim/blenderbim/bim/module/project/ui.py index 0a6b668fda..9ecef6de71 100644 --- a/src/blenderbim/blenderbim/bim/module/project/ui.py +++ b/src/blenderbim/blenderbim/bim/module/project/ui.py @@ -53,6 +53,10 @@ class BIM_PT_project(Panel): row = self.layout.row() row.prop(pprops, "filter_mode") if pprops.filter_mode in ["DECOMPOSITION", "IFC_CLASS"]: + row = self.layout.row(align=True) + row.alignment = "RIGHT" + row.operator("bim.toggle_filter_categories", text="", icon="CHECKBOX_HLT").should_select = True + row.operator("bim.toggle_filter_categories", text="", icon="CHECKBOX_DEHLT").should_select = False self.layout.template_list( "BIM_UL_filter_categories", "",