SaveBlendMetadataFile to use IFC directory for temporary file path and fix panel visibility logic in UI

This commit is contained in:
falken10vdl
2025-12-21 12:17:54 +01:00
parent fb3e35c964
commit 2cac0bdca6
2 changed files with 9 additions and 2 deletions
+3 -2
View File
@@ -260,10 +260,11 @@ class SaveBlendMetadataFile(bpy.types.Operator):
self.report({"WARNING"}, "No IFC file path set.")
return {"CANCELLED"}
blendmetadata_path = ifc_file + ".metadata.blend"
# Save a temporary copy of the current blend file
temp_path = bpy.path.abspath("//__temp_blendmetadata.blend")
ifc_dir = os.path.dirname(ifc_file)
temp_path = os.path.join(ifc_dir, "__temp_blendmetadata.blend")
bpy.ops.wm.save_as_mainfile(filepath=temp_path, copy=True)
cleanup_script = f"""
+6
View File
@@ -1633,6 +1633,8 @@ class BIM_PT_tab_representations(Panel):
def poll(cls, context):
if not should_show_panel(cls.bl_idname, cls.bim_tab_name, context):
return False
if tool.Blender.is_tab(context, cls.bim_tab_name) and tool.Ifc.get():
return True
return tool.Blender.is_tab(context, "BOOKMARK")
def draw(self, context):
@@ -1675,6 +1677,8 @@ class BIM_PT_tab_parametric_geometry(Panel):
def poll(cls, context):
if not should_show_panel(cls.bl_idname, cls.bim_tab_name, context):
return False
if tool.Blender.is_tab(context, cls.bim_tab_name) and tool.Ifc.get():
return True
return tool.Blender.is_tab(context, "BOOKMARK")
def draw(self, context):
@@ -1694,6 +1698,8 @@ class BIM_PT_tab_object_materials(Panel):
def poll(cls, context):
if not should_show_panel(cls.bl_idname, cls.bim_tab_name, context):
return False
if tool.Blender.is_tab(context, cls.bim_tab_name) and tool.Ifc.get():
return True
return tool.Blender.is_tab(context, "BOOKMARK")
def draw(self, context):