mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 22:10:00 +00:00
major refactor using blender props which we cna now save teh belnd metadata
This commit is contained in:
@@ -137,8 +137,6 @@ classes = [
|
|||||||
operator.BIM_OT_manage_tab_panels,
|
operator.BIM_OT_manage_tab_panels,
|
||||||
operator.BIM_OT_manage_tab_visibility,
|
operator.BIM_OT_manage_tab_visibility,
|
||||||
operator.BIM_OT_toggle_tab_visibility,
|
operator.BIM_OT_toggle_tab_visibility,
|
||||||
operator.BIM_OT_load_json_layout,
|
|
||||||
operator.BIM_OT_save_json_layout,
|
|
||||||
operator.BIM_OT_reset_ui_layout,
|
operator.BIM_OT_reset_ui_layout,
|
||||||
prop.ObjProperty,
|
prop.ObjProperty,
|
||||||
prop.MultipleFileSelect,
|
prop.MultipleFileSelect,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import bonsai.bim
|
|||||||
import bonsai.tool as tool
|
import bonsai.tool as tool
|
||||||
import bonsai.bim.handler
|
import bonsai.bim.handler
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from bonsai.bim.ui import TAB_PANELS, TAB_VISIBILITY
|
from bonsai.bim.ui import TAB_PANELS, get_tab_visibility, set_tab_visibility, get_tab_names
|
||||||
from bpy_extras.io_utils import ImportHelper
|
from bpy_extras.io_utils import ImportHelper
|
||||||
from bonsai.bim import import_ifc
|
from bonsai.bim import import_ifc
|
||||||
from bonsai.bim.prop import StrProperty
|
from bonsai.bim.prop import StrProperty
|
||||||
@@ -1860,15 +1860,14 @@ class BIM_OT_manage_tab_visibility(bpy.types.Operator):
|
|||||||
row.alignment = "RIGHT"
|
row.alignment = "RIGHT"
|
||||||
|
|
||||||
row.operator("bim.reset_ui_layout", icon="FILE_REFRESH", text="")
|
row.operator("bim.reset_ui_layout", icon="FILE_REFRESH", text="")
|
||||||
row.operator("bim.load_json_layout", icon="IMPORT", text="")
|
|
||||||
row.operator("bim.save_json_layout", icon="EXPORT", text="")
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
row.alignment = "CENTER"
|
row.alignment = "CENTER"
|
||||||
|
|
||||||
for tab_name, is_visible in TAB_VISIBILITY.items():
|
for tab_name in get_tab_names():
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.label(text=tab_name)
|
row.label(text=tab_name)
|
||||||
|
is_visible = get_tab_visibility(tab_name)
|
||||||
icon = "HIDE_OFF" if is_visible else "HIDE_ON"
|
icon = "HIDE_OFF" if is_visible else "HIDE_ON"
|
||||||
op = row.operator("bim.toggle_tab_visibility", text="", icon=icon)
|
op = row.operator("bim.toggle_tab_visibility", text="", icon=icon)
|
||||||
op.tab_name = tab_name
|
op.tab_name = tab_name
|
||||||
@@ -1890,8 +1889,9 @@ class BIM_OT_toggle_tab_visibility(bpy.types.Operator):
|
|||||||
tab_name: bpy.props.StringProperty()
|
tab_name: bpy.props.StringProperty()
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
if self.tab_name in TAB_VISIBILITY:
|
if self.tab_name in get_tab_names():
|
||||||
TAB_VISIBILITY[self.tab_name] = not TAB_VISIBILITY[self.tab_name]
|
current_visibility = get_tab_visibility(self.tab_name)
|
||||||
|
set_tab_visibility(self.tab_name, not current_visibility)
|
||||||
|
|
||||||
for area in bpy.context.window.screen.areas:
|
for area in bpy.context.window.screen.areas:
|
||||||
if area.type == "PROPERTIES":
|
if area.type == "PROPERTIES":
|
||||||
@@ -1901,113 +1901,8 @@ class BIM_OT_toggle_tab_visibility(bpy.types.Operator):
|
|||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
import json
|
|
||||||
import bpy
|
|
||||||
|
|
||||||
|
|
||||||
class BIM_OT_load_json_layout(bpy.types.Operator):
|
|
||||||
"""Load JSON Layout"""
|
|
||||||
|
|
||||||
bl_idname = "bim.load_json_layout"
|
|
||||||
bl_label = "Load UI Layout"
|
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
|
||||||
|
|
||||||
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
|
|
||||||
|
|
||||||
def execute(self, context):
|
|
||||||
global TAB_VISIBILITY, TAB_PANELS
|
|
||||||
|
|
||||||
try:
|
|
||||||
with open(self.filepath, "r") as file:
|
|
||||||
data = json.load(file)
|
|
||||||
|
|
||||||
if "TAB_VISIBILITY" in data:
|
|
||||||
TAB_VISIBILITY.update(data["TAB_VISIBILITY"])
|
|
||||||
|
|
||||||
if "TAB_PANELS" in data:
|
|
||||||
TAB_PANELS.update(data["TAB_PANELS"])
|
|
||||||
|
|
||||||
if "scene_properties" in data:
|
|
||||||
for prop_name, value in data["scene_properties"].items():
|
|
||||||
if hasattr(context.scene, prop_name):
|
|
||||||
setattr(context.scene, prop_name, value)
|
|
||||||
|
|
||||||
for area in bpy.context.window.screen.areas:
|
|
||||||
if area.type == "PROPERTIES":
|
|
||||||
area.tag_redraw()
|
|
||||||
|
|
||||||
self.report({"INFO"}, f"Loaded JSON layout from {self.filepath}")
|
|
||||||
except Exception as e:
|
|
||||||
self.report({"ERROR"}, f"Failed to load JSON layout: {e}")
|
|
||||||
return {"CANCELLED"}
|
|
||||||
|
|
||||||
return {"FINISHED"}
|
|
||||||
|
|
||||||
def invoke(self, context, event):
|
|
||||||
ifc_file_path = bpy.context.scene.BIMProperties["ifc_file"]
|
|
||||||
if not ifc_file_path:
|
|
||||||
self.report({"ERROR"}, "No IFC file is associated with the project.")
|
|
||||||
return {"CANCELLED"}
|
|
||||||
|
|
||||||
self.filepath = os.path.join(os.path.dirname(ifc_file_path), ".bonsai_layout_json")
|
|
||||||
context.window_manager.fileselect_add(self)
|
|
||||||
return {"RUNNING_MODAL"}
|
|
||||||
|
|
||||||
|
|
||||||
class BIM_OT_save_json_layout(bpy.types.Operator):
|
|
||||||
"""Save JSON Layout"""
|
|
||||||
|
|
||||||
bl_idname = "bim.save_json_layout"
|
|
||||||
bl_label = "Save UI Layout"
|
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
|
||||||
|
|
||||||
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
|
|
||||||
|
|
||||||
def execute(self, context):
|
|
||||||
try:
|
|
||||||
ifc_file_path = bpy.context.scene.BIMProperties["ifc_file"]
|
|
||||||
if not ifc_file_path:
|
|
||||||
self.report({"ERROR"}, "No IFC file is associated with the project.")
|
|
||||||
return {"CANCELLED"}
|
|
||||||
|
|
||||||
layout_data = {
|
|
||||||
"TAB_VISIBILITY": TAB_VISIBILITY,
|
|
||||||
"TAB_PANELS": TAB_PANELS,
|
|
||||||
"scene_properties": {},
|
|
||||||
}
|
|
||||||
|
|
||||||
for tab_name, panels in TAB_PANELS.items():
|
|
||||||
for panel in panels:
|
|
||||||
panel_name = panel.get("bl_idname", "")
|
|
||||||
if not panel_name:
|
|
||||||
continue
|
|
||||||
|
|
||||||
show_prop_name = f"show_{panel_name.lower()}"
|
|
||||||
bookmark_prop_name = f"bookmark_{panel_name.lower()}"
|
|
||||||
layout_data["scene_properties"][show_prop_name] = getattr(context.scene, show_prop_name, True)
|
|
||||||
layout_data["scene_properties"][bookmark_prop_name] = getattr(
|
|
||||||
context.scene, bookmark_prop_name, False
|
|
||||||
)
|
|
||||||
|
|
||||||
with open(self.filepath, "w") as file:
|
|
||||||
json.dump(layout_data, file, indent=4)
|
|
||||||
self.report({"INFO"}, f"Saved JSON layout to {self.filepath}")
|
|
||||||
except Exception as e:
|
|
||||||
self.report({"ERROR"}, f"Failed to save JSON layout: {e}")
|
|
||||||
return {"CANCELLED"}
|
|
||||||
|
|
||||||
return {"FINISHED"}
|
|
||||||
|
|
||||||
def invoke(self, context, event):
|
|
||||||
ifc_file_path = bpy.context.scene.BIMProperties["ifc_file"]
|
|
||||||
if not ifc_file_path:
|
|
||||||
self.report({"ERROR"}, "No IFC file is associated with the project.")
|
|
||||||
return {"CANCELLED"}
|
|
||||||
|
|
||||||
self.filepath = os.path.join(os.path.dirname(ifc_file_path), ".bonsai_layout_json")
|
|
||||||
context.window_manager.fileselect_add(self)
|
|
||||||
return {"RUNNING_MODAL"}
|
|
||||||
|
|
||||||
|
|
||||||
class BIM_OT_reset_ui_layout(bpy.types.Operator):
|
class BIM_OT_reset_ui_layout(bpy.types.Operator):
|
||||||
"""Reset UI Layout to Default"""
|
"""Reset UI Layout to Default"""
|
||||||
@@ -2017,10 +1912,10 @@ class BIM_OT_reset_ui_layout(bpy.types.Operator):
|
|||||||
bl_options = {"REGISTER", "UNDO"}
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
global TAB_VISIBILITY, TAB_PANELS
|
global TAB_PANELS
|
||||||
|
|
||||||
for tab_name in TAB_VISIBILITY.keys():
|
for tab_name in get_tab_names():
|
||||||
TAB_VISIBILITY[tab_name] = True
|
set_tab_visibility(tab_name, True)
|
||||||
|
|
||||||
TAB_PANELS["BOOKMARK"] = [{}]
|
TAB_PANELS["BOOKMARK"] = [{}]
|
||||||
|
|
||||||
|
|||||||
@@ -613,7 +613,17 @@ class BIMProperties(PropertyGroup):
|
|||||||
],
|
],
|
||||||
name="Time Unit",
|
name="Time Unit",
|
||||||
default="HOUR",
|
default="HOUR",
|
||||||
)
|
) tab_visibility_project: BoolProperty(name="Project Tab Visible", default=True)
|
||||||
|
tab_visibility_object: BoolProperty(name="Object Tab Visible", default=True)
|
||||||
|
tab_visibility_geometry: BoolProperty(name="Geometry Tab Visible", default=True)
|
||||||
|
tab_visibility_drawings: BoolProperty(name="Drawings Tab Visible", default=True)
|
||||||
|
tab_visibility_services: BoolProperty(name="Services Tab Visible", default=True)
|
||||||
|
tab_visibility_structure: BoolProperty(name="Structure Tab Visible", default=True)
|
||||||
|
tab_visibility_scheduling: BoolProperty(name="Scheduling Tab Visible", default=True)
|
||||||
|
tab_visibility_fm: BoolProperty(name="FM Tab Visible", default=True)
|
||||||
|
tab_visibility_quality: BoolProperty(name="Quality Tab Visible", default=True)
|
||||||
|
tab_visibility_bookmark: BoolProperty(name="Bookmark Tab Visible", default=True)
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
is_dirty: bool
|
is_dirty: bool
|
||||||
schema_dir: str
|
schema_dir: str
|
||||||
@@ -628,6 +638,16 @@ class BIMProperties(PropertyGroup):
|
|||||||
volume_unit: str
|
volume_unit: str
|
||||||
mass_unit: str
|
mass_unit: str
|
||||||
time_unit: str
|
time_unit: str
|
||||||
|
tab_visibility_project: bool
|
||||||
|
tab_visibility_object: bool
|
||||||
|
tab_visibility_geometry: bool
|
||||||
|
tab_visibility_drawings: bool
|
||||||
|
tab_visibility_services: bool
|
||||||
|
tab_visibility_structure: bool
|
||||||
|
tab_visibility_scheduling: bool
|
||||||
|
tab_visibility_fm: bool
|
||||||
|
tab_visibility_quality: bool
|
||||||
|
tab_visibility_bookmark: bool
|
||||||
|
|
||||||
|
|
||||||
class IfcParameter(PropertyGroup):
|
class IfcParameter(PropertyGroup):
|
||||||
|
|||||||
+254
-185
@@ -124,23 +124,26 @@ TAB_PANELS = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TAB_VISIBILITY = {
|
def get_tab_visibility(tab_name):
|
||||||
"PROJECT": True,
|
bim_props = tool.Blender.get_bim_props()
|
||||||
"OBJECT": True,
|
prop_name = f"tab_visibility_{tab_name.lower()}"
|
||||||
"GEOMETRY": True,
|
return getattr(bim_props, prop_name, True)
|
||||||
"DRAWINGS": True,
|
|
||||||
"SERVICES": True,
|
|
||||||
"STRUCTURE": True,
|
def set_tab_visibility(tab_name, visible):
|
||||||
"SCHEDULING": True,
|
bim_props = tool.Blender.get_bim_props()
|
||||||
"FM": True,
|
prop_name = f"tab_visibility_{tab_name.lower()}"
|
||||||
"QUALITY": True,
|
if hasattr(bim_props, prop_name):
|
||||||
"BOOKMARK": True,
|
setattr(bim_props, prop_name, visible)
|
||||||
}
|
|
||||||
|
|
||||||
|
def get_tab_names():
|
||||||
|
return list(TAB_PANELS.keys())
|
||||||
|
|
||||||
|
|
||||||
def get_tab_name(bl_idname):
|
def get_tab_name(bl_idname):
|
||||||
return next(
|
return next(
|
||||||
(k for k, v in reversed(list(TAB_PANELS.items())) if any(d.get("bl_idname") == bl_idname for d in v)),
|
(k for k, v in reversed(list(TAB_PANELS.items())) if k != "BOOKMARK" and any(d.get("bl_idname") == bl_idname for d in v)),
|
||||||
"BOOKMARK",
|
"BOOKMARK",
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1048,30 +1051,30 @@ class BIM_PT_tabs(Panel):
|
|||||||
col_left = split.column(align=True)
|
col_left = split.column(align=True)
|
||||||
row_left = col_left.row(align=True)
|
row_left = col_left.row(align=True)
|
||||||
row_left.alignment = "CENTER"
|
row_left.alignment = "CENTER"
|
||||||
if TAB_VISIBILITY["PROJECT"]:
|
if get_tab_visibility("PROJECT"):
|
||||||
row_left.operator(
|
row_left.operator(
|
||||||
"bim.set_tab",
|
"bim.set_tab",
|
||||||
text="",
|
text="",
|
||||||
emboss=aprops.tab == "PROJECT",
|
emboss=aprops.tab == "PROJECT",
|
||||||
icon_value=bonsai.bim.icons[ifc_icon].icon_id,
|
icon_value=bonsai.bim.icons[ifc_icon].icon_id,
|
||||||
).tab = "PROJECT"
|
).tab = "PROJECT"
|
||||||
if TAB_VISIBILITY["OBJECT"]:
|
if get_tab_visibility("OBJECT"):
|
||||||
self.draw_tab_entry(row_left, "FILE_3D", "OBJECT", is_ifc_project, aprops.tab == "OBJECT")
|
self.draw_tab_entry(row_left, "FILE_3D", "OBJECT", is_ifc_project, aprops.tab == "OBJECT")
|
||||||
if TAB_VISIBILITY["GEOMETRY"]:
|
if get_tab_visibility("GEOMETRY"):
|
||||||
self.draw_tab_entry(row_left, "MATERIAL", "GEOMETRY", is_ifc_project, aprops.tab == "GEOMETRY")
|
self.draw_tab_entry(row_left, "MATERIAL", "GEOMETRY", is_ifc_project, aprops.tab == "GEOMETRY")
|
||||||
if TAB_VISIBILITY["DRAWINGS"]:
|
if get_tab_visibility("DRAWINGS"):
|
||||||
self.draw_tab_entry(row_left, "DOCUMENTS", "DRAWINGS", is_ifc_project, aprops.tab == "DRAWINGS")
|
self.draw_tab_entry(row_left, "DOCUMENTS", "DRAWINGS", is_ifc_project, aprops.tab == "DRAWINGS")
|
||||||
if TAB_VISIBILITY["SERVICES"]:
|
if get_tab_visibility("SERVICES"):
|
||||||
self.draw_tab_entry(row_left, "NETWORK_DRIVE", "SERVICES", is_ifc_project, aprops.tab == "SERVICES")
|
self.draw_tab_entry(row_left, "NETWORK_DRIVE", "SERVICES", is_ifc_project, aprops.tab == "SERVICES")
|
||||||
if TAB_VISIBILITY["STRUCTURE"]:
|
if get_tab_visibility("STRUCTURE"):
|
||||||
self.draw_tab_entry(row_left, "EDITMODE_HLT", "STRUCTURE", is_ifc_project, aprops.tab == "STRUCTURE")
|
self.draw_tab_entry(row_left, "EDITMODE_HLT", "STRUCTURE", is_ifc_project, aprops.tab == "STRUCTURE")
|
||||||
if TAB_VISIBILITY["SCHEDULING"]:
|
if get_tab_visibility("SCHEDULING"):
|
||||||
self.draw_tab_entry(row_left, "NLA", "SCHEDULING", is_ifc_project, aprops.tab == "SCHEDULING")
|
self.draw_tab_entry(row_left, "NLA", "SCHEDULING", is_ifc_project, aprops.tab == "SCHEDULING")
|
||||||
if TAB_VISIBILITY["FM"]:
|
if get_tab_visibility("FM"):
|
||||||
self.draw_tab_entry(row_left, "PACKAGE", "FM", True, aprops.tab == "FM")
|
self.draw_tab_entry(row_left, "PACKAGE", "FM", True, aprops.tab == "FM")
|
||||||
if TAB_VISIBILITY["QUALITY"]:
|
if get_tab_visibility("QUALITY"):
|
||||||
self.draw_tab_entry(row_left, "COMMUNITY", "QUALITY", True, aprops.tab == "QUALITY")
|
self.draw_tab_entry(row_left, "COMMUNITY", "QUALITY", True, aprops.tab == "QUALITY")
|
||||||
if TAB_VISIBILITY["BOOKMARK"]:
|
if get_tab_visibility("BOOKMARK"):
|
||||||
self.draw_tab_entry(row_left, "SOLO_ON", "BOOKMARK", True, aprops.tab == "BOOKMARK") # New BOOKMARK tab
|
self.draw_tab_entry(row_left, "SOLO_ON", "BOOKMARK", True, aprops.tab == "BOOKMARK") # New BOOKMARK tab
|
||||||
row_left.operator("bim.switch_tab", text="", emboss=False, icon="UV_SYNC_SELECT")
|
row_left.operator("bim.switch_tab", text="", emboss=False, icon="UV_SYNC_SELECT")
|
||||||
|
|
||||||
@@ -1079,9 +1082,9 @@ class BIM_PT_tabs(Panel):
|
|||||||
# Yes, that's right.
|
# Yes, that's right.
|
||||||
row_left.alignment = "CENTER"
|
row_left.alignment = "CENTER"
|
||||||
row_left.scale_y = 0.2
|
row_left.scale_y = 0.2
|
||||||
for tab in TAB_VISIBILITY.keys():
|
for tab in get_tab_names():
|
||||||
# Draw a little underscore below the active tab icon.
|
# Draw a little underscore below the active tab icon.
|
||||||
if TAB_VISIBILITY[tab]:
|
if get_tab_visibility(tab):
|
||||||
if aprops.tab == tab:
|
if aprops.tab == tab:
|
||||||
row_left.prop(aprops, "active_tab", text="", icon="BLANK1")
|
row_left.prop(aprops, "active_tab", text="", icon="BLANK1")
|
||||||
else:
|
else:
|
||||||
@@ -1098,8 +1101,8 @@ class BIM_PT_tabs(Panel):
|
|||||||
row.prop(aprops, "tab", text="")
|
row.prop(aprops, "tab", text="")
|
||||||
|
|
||||||
# Add gear icons for all tabs except SWITCH_TAB
|
# Add gear icons for all tabs except SWITCH_TAB
|
||||||
for tab in TAB_VISIBILITY.keys():
|
for tab in get_tab_names():
|
||||||
if TAB_VISIBILITY[tab]:
|
if get_tab_visibility(tab):
|
||||||
if aprops.tab == tab:
|
if aprops.tab == tab:
|
||||||
row.operator("bim.manage_tab_panels", text="", icon="PREFERENCES").tab_name = tab
|
row.operator("bim.manage_tab_panels", text="", icon="PREFERENCES").tab_name = tab
|
||||||
|
|
||||||
@@ -1208,20 +1211,18 @@ class BIM_PT_tab_project_info(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)):
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
bim_props = tool.Blender.get_bim_props()
|
||||||
if not tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)):
|
pprops = tool.Project.get_project_props()
|
||||||
|
if pprops.is_loading:
|
||||||
return False
|
return True
|
||||||
bim_props = tool.Blender.get_bim_props()
|
elif tool.Ifc.get() or bim_props.ifc_file:
|
||||||
pprops = tool.Project.get_project_props()
|
return True
|
||||||
if pprops.is_loading:
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
return True
|
|
||||||
elif tool.Ifc.get() or bim_props.ifc_file:
|
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -1241,13 +1242,15 @@ class BIM_PT_tab_spatial(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1264,13 +1267,15 @@ class BIM_PT_tab_project_setup(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)):
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname))
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1288,13 +1293,15 @@ class BIM_PT_tab_stakeholders(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1311,13 +1318,15 @@ class BIM_PT_tab_collaboration(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)):
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname))
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1335,13 +1344,15 @@ class BIM_PT_tab_grouping_and_filtering(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1366,13 +1377,15 @@ class BIM_PT_tab_geometry(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1389,13 +1402,15 @@ class BIM_PT_tab_status(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1412,13 +1427,15 @@ class BIM_PT_tab_qto(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1435,13 +1452,15 @@ class BIM_PT_tab_resources(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1458,13 +1477,15 @@ class BIM_PT_tab_cost(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1481,13 +1502,15 @@ class BIM_PT_tab_sequence(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1504,13 +1527,15 @@ class BIM_PT_tab_structural(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1527,13 +1552,15 @@ class BIM_PT_tab_services(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1550,13 +1577,15 @@ class BIM_PT_tab_lighting(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1573,13 +1602,15 @@ class BIM_PT_tab_zones(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1596,13 +1627,15 @@ class BIM_PT_tab_solar_analysis(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1619,13 +1652,15 @@ class BIM_PT_tab_quality_control(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)):
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname))
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1642,13 +1677,15 @@ class BIM_PT_tab_clash_detection(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)):
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname))
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1666,13 +1703,15 @@ class BIM_PT_tab_sandbox(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)):
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname))
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
@@ -1692,15 +1731,12 @@ class BIM_PT_tab_object_metadata(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
|
||||||
|
|
||||||
props = tool.Project.get_project_props()
|
props = tool.Project.get_project_props()
|
||||||
return (
|
if (
|
||||||
tool.Blender.is_tab(context, get_tab_name(cls.bl_idname))
|
tool.Blender.is_tab(context, get_tab_name(cls.bl_idname))
|
||||||
and tool.Ifc.get()
|
and tool.Ifc.get()
|
||||||
and (obj := context.active_object)
|
and (obj := context.active_object)
|
||||||
@@ -1710,7 +1746,11 @@ class BIM_PT_tab_object_metadata(Panel):
|
|||||||
or not obj.instance_collection
|
or not obj.instance_collection
|
||||||
or not any(l.empty_handle == obj for l in props.links)
|
or not any(l.empty_handle == obj for l in props.links)
|
||||||
)
|
)
|
||||||
)
|
):
|
||||||
|
return True
|
||||||
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1728,19 +1768,20 @@ class BIM_PT_tab_placement(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if (
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
|
||||||
|
|
||||||
return (
|
|
||||||
tool.Blender.is_tab(context, get_tab_name(cls.bl_idname))
|
tool.Blender.is_tab(context, get_tab_name(cls.bl_idname))
|
||||||
and tool.Ifc.get()
|
and tool.Ifc.get()
|
||||||
and (obj := context.active_object)
|
and (obj := context.active_object)
|
||||||
and tool.Ifc.get_entity(obj)
|
and tool.Ifc.get_entity(obj)
|
||||||
)
|
):
|
||||||
|
return True
|
||||||
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1758,17 +1799,19 @@ class BIM_PT_tab_representations(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if (
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
|
||||||
return (
|
|
||||||
tool.Blender.is_tab(context, get_tab_name(cls.bl_idname))
|
tool.Blender.is_tab(context, get_tab_name(cls.bl_idname))
|
||||||
and tool.Ifc.get()
|
and tool.Ifc.get()
|
||||||
and tool.Geometry.get_active_or_representation_obj()
|
and tool.Geometry.get_active_or_representation_obj()
|
||||||
)
|
):
|
||||||
|
return True
|
||||||
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1787,13 +1830,15 @@ class BIM_PT_tab_geometric_relationships(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1812,18 +1857,20 @@ class BIM_PT_tab_parametric_geometry(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if (
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
|
||||||
return (
|
|
||||||
tool.Blender.is_tab(context, get_tab_name(cls.bl_idname))
|
tool.Blender.is_tab(context, get_tab_name(cls.bl_idname))
|
||||||
and tool.Ifc.get()
|
and tool.Ifc.get()
|
||||||
and (obj := context.active_object)
|
and (obj := context.active_object)
|
||||||
and tool.Ifc.get_entity(obj)
|
and tool.Ifc.get_entity(obj)
|
||||||
)
|
):
|
||||||
|
return True
|
||||||
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1841,18 +1888,20 @@ class BIM_PT_tab_object_materials(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if (
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
|
||||||
return (
|
|
||||||
tool.Blender.is_tab(context, get_tab_name(cls.bl_idname))
|
tool.Blender.is_tab(context, get_tab_name(cls.bl_idname))
|
||||||
and tool.Ifc.get()
|
and tool.Ifc.get()
|
||||||
and (obj := context.active_object)
|
and (obj := context.active_object)
|
||||||
and tool.Ifc.get_entity(obj)
|
and tool.Ifc.get_entity(obj)
|
||||||
)
|
):
|
||||||
|
return True
|
||||||
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1870,13 +1919,15 @@ class BIM_PT_tab_materials(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1894,13 +1945,15 @@ class BIM_PT_tab_styles(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1918,13 +1971,15 @@ class BIM_PT_tab_profiles(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1942,13 +1997,15 @@ class BIM_PT_tab_sheets(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1966,13 +2023,15 @@ class BIM_PT_tab_drawings(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -1990,13 +2049,15 @@ class BIM_PT_tab_schedules(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -2014,13 +2075,15 @@ class BIM_PT_tab_references(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -2039,13 +2102,15 @@ class BIM_PT_tab_misc(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get():
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)) and tool.Ifc.get()
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -2063,13 +2128,15 @@ class BIM_PT_tab_handover(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)):
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname))
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -2087,13 +2154,15 @@ class BIM_PT_tab_operations(Panel):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
prop_bookmark = f"bookmark_{cls.bl_idname.lower()}"
|
||||||
prop_visible = f"show_{cls.bl_idname.lower()}"
|
prop_visible = f"show_{cls.bl_idname.lower()}"
|
||||||
if not TAB_VISIBILITY[get_tab_name(cls.bl_idname)]:
|
if not get_tab_visibility(get_tab_name(cls.bl_idname)):
|
||||||
return False
|
return False
|
||||||
if not getattr(context.scene, prop_visible, True):
|
if not getattr(context.scene, prop_visible, True):
|
||||||
return False
|
return False
|
||||||
if getattr(context.scene, prop_bookmark, False):
|
if tool.Blender.is_tab(context, get_tab_name(cls.bl_idname)):
|
||||||
return tool.Blender.is_tab(context, "BOOKMARK")
|
return True
|
||||||
return tool.Blender.is_tab(context, get_tab_name(cls.bl_idname))
|
if tool.Blender.is_tab(context, "BOOKMARK") and getattr(context.scene, prop_bookmark, False):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user