mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 17:57:02 +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))
|
core.set_orientation_slot(tool.Spatial, container=tool.Ifc.get().by_id(self.container))
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
class SetContainerVisibility(bpy.types.Operator):
|
class SetContainerVisibility(bpy.types.Operator):
|
||||||
bl_idname = "bim.set_container_visibility"
|
bl_idname = "bim.set_container_visibility"
|
||||||
bl_label = "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))
|
queue.extend(ifcopenshell.util.element.get_parts(container))
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
class SetElementVisibility(bpy.types.Operator):
|
class SetElementVisibility(bpy.types.Operator):
|
||||||
bl_idname = "bim.set_element_visibility"
|
bl_idname = "bim.set_element_visibility"
|
||||||
bl_label = "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
|
# Only show container visibility operators if the preference is enabled
|
||||||
from bonsai.bim.ui import BIM_ADDON_preferences
|
from bonsai.bim.ui import BIM_ADDON_preferences
|
||||||
|
|
||||||
addon = BIM_ADDON_preferences.get_addon_instance()
|
addon = BIM_ADDON_preferences.get_addon_instance()
|
||||||
if addon and getattr(addon, "preferences", None):
|
if addon and getattr(addon, "preferences", None):
|
||||||
prefs = addon.preferences
|
prefs = addon.preferences
|
||||||
|
|||||||
@@ -679,9 +679,11 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
|
|||||||
)
|
)
|
||||||
|
|
||||||
addon_instance = None
|
addon_instance = None
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def set_addon_instance(cls):
|
def set_addon_instance(cls):
|
||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
instance = None
|
instance = None
|
||||||
for key in bpy.context.preferences.addons.keys():
|
for key in bpy.context.preferences.addons.keys():
|
||||||
if ".bonsai" in key:
|
if ".bonsai" in key:
|
||||||
|
|||||||
Reference in New Issue
Block a user