From 27c52fe6d58653544ccc994a86fc6459e177e586 Mon Sep 17 00:00:00 2001 From: Trashman247 Date: Fri, 7 Apr 2023 20:55:59 -0700 Subject: [PATCH] Add dynamic tool tip for parametrized "Save" in IFC project --- .../blenderbim/bim/module/project/operator.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/project/operator.py b/src/blenderbim/blenderbim/bim/module/project/operator.py index aa47238327..97700c88c6 100644 --- a/src/blenderbim/blenderbim/bim/module/project/operator.py +++ b/src/blenderbim/blenderbim/bim/module/project/operator.py @@ -812,7 +812,6 @@ class ExportIFC(bpy.types.Operator): bl_idname = "export_ifc.bim" bl_label = "Export IFC" bl_options = {"REGISTER", "UNDO"} - bl_description = "Export the IFC project" filename_ext = ".ifc" filter_glob: bpy.props.StringProperty(default="*.ifc;*.ifczip;*.ifcxml;*.ifcjson", options={"HIDDEN"}) filepath: bpy.props.StringProperty(subtype="FILE_PATH") @@ -820,7 +819,7 @@ class ExportIFC(bpy.types.Operator): json_compact: bpy.props.BoolProperty(name="Export Compact IFCJSON", default=False) should_save_as: bpy.props.BoolProperty(name="Should Save As", default=False) use_relative_path: bpy.props.BoolProperty(name="Use Relative Path", default=False) - + def invoke(self, context, event): if not IfcStore.get_file(): self.report({"ERROR"}, "No IFC project is available for export - create or import a project first.") @@ -891,6 +890,13 @@ class ExportIFC(bpy.types.Operator): bpy.ops.wm.save_mainfile(filepath=bpy.data.filepath) blenderbim.bim.handler.purge_module_data() return {"FINISHED"} + + @classmethod + def description(cls, context, properties): + if properties.should_save_as == False: + return "Export the IFC project to this file" + else: + return "Export the IFC project to a selected file" class ImportIFC(bpy.types.Operator):