mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 10:06:47 +00:00
black
This commit is contained in:
@@ -507,6 +507,7 @@ class SetDefaultContainer(bpy.types.Operator):
|
||||
core.set_orientation_slot(tool.Spatial, container=tool.Ifc.get().by_id(self.container))
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class SetContainerVisibility(bpy.types.Operator):
|
||||
bl_idname = "bim.set_container_visibility"
|
||||
bl_label = "Set Container Visibility"
|
||||
@@ -554,6 +555,7 @@ class SetContainerVisibility(bpy.types.Operator):
|
||||
queue.extend(ifcopenshell.util.element.get_parts(container))
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class SetElementVisibility(bpy.types.Operator):
|
||||
bl_idname = "bim.set_element_visibility"
|
||||
bl_label = "Set Element Visibility"
|
||||
|
||||
@@ -134,6 +134,7 @@ class BIM_PT_spatial_decomposition(Panel):
|
||||
|
||||
# Only show container visibility operators if the preference is enabled
|
||||
from bonsai.bim.ui import BIM_ADDON_preferences
|
||||
|
||||
addon = BIM_ADDON_preferences.get_addon_instance()
|
||||
if addon and getattr(addon, "preferences", None):
|
||||
prefs = addon.preferences
|
||||
|
||||
@@ -679,9 +679,11 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
|
||||
)
|
||||
|
||||
addon_instance = None
|
||||
|
||||
@classmethod
|
||||
def set_addon_instance(cls):
|
||||
import bpy
|
||||
|
||||
instance = None
|
||||
for key in bpy.context.preferences.addons.keys():
|
||||
if ".bonsai" in key:
|
||||
|
||||
Reference in New Issue
Block a user