From 595ee3fa470887e8e95b19e63820711924b96359 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 24 Mar 2025 11:33:10 +0500 Subject: [PATCH] Provide descriptions to all operators that use `fileselect_add` #6420 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I guess all it takes a persistent Blender crash to fill up operators descriptions 😅 --- src/bonsai/bonsai/bim/module/bcf/operator.py | 5 +++++ src/bonsai/bonsai/bim/module/brick/operator.py | 2 ++ src/bonsai/bonsai/bim/module/clash/operator.py | 2 ++ src/bonsai/bonsai/bim/module/classification/operator.py | 1 + src/bonsai/bonsai/bim/module/csv/operator.py | 3 +++ src/bonsai/bonsai/bim/module/diff/operator.py | 4 ++++ src/bonsai/bonsai/bim/module/drawing/operator.py | 1 + src/bonsai/bonsai/bim/module/fm/operator.py | 3 +++ src/bonsai/bonsai/bim/module/georeference/operator.py | 2 +- src/bonsai/bonsai/bim/module/model/sverchok_modifier.py | 2 ++ src/bonsai/bonsai/bim/module/patch/operator.py | 2 ++ src/bonsai/bonsai/bim/module/project/operator.py | 2 ++ src/bonsai/bonsai/bim/module/style/operator.py | 2 ++ src/bonsai/bonsai/bim/module/tester/operator.py | 1 + 14 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/bonsai/bonsai/bim/module/bcf/operator.py b/src/bonsai/bonsai/bim/module/bcf/operator.py index 0c145d98f8..df07babe69 100644 --- a/src/bonsai/bonsai/bim/module/bcf/operator.py +++ b/src/bonsai/bonsai/bim/module/bcf/operator.py @@ -66,6 +66,7 @@ class NewBcfProject(bpy.types.Operator): class LoadBcfProject(bpy.types.Operator): bl_idname = "bim.load_bcf_project" bl_label = "Load BCF Project" + bl_description = "Load the BCF file." bl_options = {"REGISTER", "UNDO"} filepath: bpy.props.StringProperty(subtype="FILE_PATH", options={"SKIP_SAVE"}) filter_glob: bpy.props.StringProperty(default="*.bcf;*.bcfzip", options={"HIDDEN"}) @@ -344,6 +345,7 @@ class EditBcfTopic(bpy.types.Operator): class SaveBcfProject(bpy.types.Operator): bl_idname = "bim.save_bcf_project" bl_label = "Save BCF Project" + bl_description = "Save active BCF project by the provided filepath." bl_options = {"REGISTER", "UNDO"} filepath: bpy.props.StringProperty(subtype="FILE_PATH") filter_glob: bpy.props.StringProperty(default="*.bcf;*.bcfzip", options={"HIDDEN"}) @@ -1537,6 +1539,7 @@ class OpenBcfReferenceLink(bpy.types.Operator): class SelectBcfHeaderFile(bpy.types.Operator): bl_idname = "bim.select_bcf_header_file" bl_label = "Select BCF Header File" + bl_description = "Select filepath for BCF header reference." bl_options = {"REGISTER", "UNDO"} filepath: bpy.props.StringProperty(subtype="FILE_PATH") filter_glob: bpy.props.StringProperty(default="*.ifc;*.ifczip;*.ifcxml;*.ifcjson", options={"HIDDEN"}) @@ -1555,6 +1558,7 @@ class SelectBcfHeaderFile(bpy.types.Operator): class SelectBcfBimSnippetReference(bpy.types.Operator): bl_idname = "bim.select_bcf_bim_snippet_reference" bl_label = "Select BCF BIM Snippet Reference" + bl_description = "Select filepath for BCF snippet reference." bl_options = {"REGISTER", "UNDO"} filepath: bpy.props.StringProperty(subtype="FILE_PATH") @@ -1572,6 +1576,7 @@ class SelectBcfBimSnippetReference(bpy.types.Operator): class SelectBcfDocumentReference(bpy.types.Operator): bl_idname = "bim.select_bcf_document_reference" bl_label = "Select BCF Document Reference" + bl_description = "Select filepath for BCF document reference." bl_options = {"REGISTER", "UNDO"} filepath: bpy.props.StringProperty(subtype="FILE_PATH") diff --git a/src/bonsai/bonsai/bim/module/brick/operator.py b/src/bonsai/bonsai/bim/module/brick/operator.py index 522241a88e..e9b20a215d 100644 --- a/src/bonsai/bonsai/bim/module/brick/operator.py +++ b/src/bonsai/bonsai/bim/module/brick/operator.py @@ -243,6 +243,8 @@ class RemoveBrick(bpy.types.Operator, tool.Ifc.Operator): class SerializeBrick(bpy.types.Operator): bl_idname = "bim.serialize_brick" bl_label = "Serialize Brick" + # Prevents crash on Blender 4.4.0. + bl_description = "Save active Brick project by the provided filepath." filter_glob: bpy.props.StringProperty(default="*.ttl", options={"HIDDEN"}) filepath: bpy.props.StringProperty(subtype="FILE_PATH") should_save_as: bpy.props.BoolProperty(name="Should Save As", default=False, options={"HIDDEN"}) diff --git a/src/bonsai/bonsai/bim/module/clash/operator.py b/src/bonsai/bonsai/bim/module/clash/operator.py index 3fd4e3b4de..a3e43c72d6 100644 --- a/src/bonsai/bonsai/bim/module/clash/operator.py +++ b/src/bonsai/bonsai/bim/module/clash/operator.py @@ -173,6 +173,7 @@ class SelectClashSource(bpy.types.Operator): class SelectClashResults(bpy.types.Operator): bl_idname = "bim.select_clash_results" bl_label = "Select Clash Results" + bl_description = "Select filepath for clash results." bl_options = {"REGISTER", "UNDO"} filepath: bpy.props.StringProperty(subtype="FILE_PATH") @@ -188,6 +189,7 @@ class SelectClashResults(bpy.types.Operator): class SelectSmartGroupedClashesPath(bpy.types.Operator): bl_idname = "bim.select_smart_grouped_clashes_path" bl_label = "Select Smart-Grouped Clashes Path" + bl_description = "Select filepath for smart-grouped clashes." bl_options = {"REGISTER", "UNDO"} filepath: bpy.props.StringProperty(subtype="FILE_PATH") diff --git a/src/bonsai/bonsai/bim/module/classification/operator.py b/src/bonsai/bonsai/bim/module/classification/operator.py index ab3fc08658..a2b19fcae1 100644 --- a/src/bonsai/bonsai/bim/module/classification/operator.py +++ b/src/bonsai/bonsai/bim/module/classification/operator.py @@ -31,6 +31,7 @@ from bonsai.bim.ifc import IfcStore class LoadClassificationLibrary(bpy.types.Operator, tool.Ifc.Operator): bl_idname = "bim.load_classification_library" bl_label = "Load Classification Library" + bl_description = "Load classification library from the provided filepath." filename_ext = ".ifc" filter_glob: bpy.props.StringProperty(default="*.ifc;*.ifczip;*.ifcxml", options={"HIDDEN"}) filepath: bpy.props.StringProperty(subtype="FILE_PATH") diff --git a/src/bonsai/bonsai/bim/module/csv/operator.py b/src/bonsai/bonsai/bim/module/csv/operator.py index cd9e784bf2..18667381d6 100644 --- a/src/bonsai/bonsai/bim/module/csv/operator.py +++ b/src/bonsai/bonsai/bim/module/csv/operator.py @@ -185,6 +185,7 @@ class ExportCsvAttributes(bpy.types.Operator): class ExportIfcCsv(bpy.types.Operator): bl_idname = "bim.export_ifccsv" bl_label = "Export IFC" + bl_description = "Export IFC data as a spreadsheet." filename_ext = ".csv" filepath: bpy.props.StringProperty(subtype="FILE_PATH") @@ -290,6 +291,7 @@ class ExportIfcCsv(bpy.types.Operator): class ImportIfcCsv(bpy.types.Operator, tool.Ifc.Operator): bl_idname = "bim.import_ifccsv" bl_label = "Import to IFC" + bl_description = "Import IFC data from a spreadsheet." bl_options = {"REGISTER", "UNDO"} filter_glob: bpy.props.StringProperty(default="*.csv;*.ods;*.xlsx", options={"HIDDEN"}) filepath: bpy.props.StringProperty(subtype="FILE_PATH") @@ -340,6 +342,7 @@ class ImportIfcCsv(bpy.types.Operator, tool.Ifc.Operator): class SelectCsvIfcFile(bpy.types.Operator): bl_idname = "bim.select_csv_ifc_file" bl_label = "Select CSV IFC File" + bl_description = "Select IFC file for spreadsheet import/export." bl_options = {"REGISTER", "UNDO"} filename_ext = ".ifc" filter_glob: bpy.props.StringProperty(default="*.ifc;*.ifczip;*.ifcxml", options={"HIDDEN"}) diff --git a/src/bonsai/bonsai/bim/module/diff/operator.py b/src/bonsai/bonsai/bim/module/diff/operator.py index 4c243bc28b..516b26d9ad 100644 --- a/src/bonsai/bonsai/bim/module/diff/operator.py +++ b/src/bonsai/bonsai/bim/module/diff/operator.py @@ -30,6 +30,7 @@ from bonsai.bim.ifc import IfcStore class SelectDiffJsonFile(bpy.types.Operator): bl_idname = "bim.select_diff_json_file" bl_label = "Select Diff JSON File" + bl_description = "Select filepath for IFC diff results." bl_options = {"REGISTER", "UNDO"} filepath: bpy.props.StringProperty(subtype="FILE_PATH") filter_glob: bpy.props.StringProperty(default="*.json", options={"HIDDEN"}) @@ -104,6 +105,7 @@ class VisualiseDiff(bpy.types.Operator): class SelectDiffOldFile(bpy.types.Operator): bl_idname = "bim.select_diff_old_file" bl_label = "Select Diff Old File" + bl_description = "Select filepath for an old IFC file to compare." bl_options = {"REGISTER", "UNDO"} filepath: bpy.props.StringProperty(subtype="FILE_PATH") filter_glob: bpy.props.StringProperty(default="*.ifc", options={"HIDDEN"}) @@ -120,6 +122,7 @@ class SelectDiffOldFile(bpy.types.Operator): class SelectDiffNewFile(bpy.types.Operator): bl_idname = "bim.select_diff_new_file" bl_label = "Select Diff New File" + bl_description = "Select filepath for a new IFC file to compare." bl_options = {"REGISTER", "UNDO"} filepath: bpy.props.StringProperty(subtype="FILE_PATH") filter_glob: bpy.props.StringProperty(default="*.ifc", options={"HIDDEN"}) @@ -136,6 +139,7 @@ class SelectDiffNewFile(bpy.types.Operator): class ExecuteIfcDiff(bpy.types.Operator): bl_idname = "bim.execute_ifc_diff" bl_label = "Execute IFC Diff" + bl_description = "Compare two IFC files and save a json diff report by the provided filepath." filename_ext = ".json" filepath: bpy.props.StringProperty(subtype="FILE_PATH") filter_glob: bpy.props.StringProperty(default="*.json", options={"HIDDEN"}) diff --git a/src/bonsai/bonsai/bim/module/drawing/operator.py b/src/bonsai/bonsai/bim/module/drawing/operator.py index ba1f593096..0cc32e5d07 100644 --- a/src/bonsai/bonsai/bim/module/drawing/operator.py +++ b/src/bonsai/bonsai/bim/module/drawing/operator.py @@ -2216,6 +2216,7 @@ class ActivateDrawingFromSheet(bpy.types.Operator, ActivateDrawingBase): return True +# TODO: not exposed to the UI. class SelectDocIfcFile(bpy.types.Operator): bl_idname = "bim.select_doc_ifc_file" bl_label = "Select Documentation IFC File" diff --git a/src/bonsai/bonsai/bim/module/fm/operator.py b/src/bonsai/bonsai/bim/module/fm/operator.py index 6776c27e14..c78f70dee4 100644 --- a/src/bonsai/bonsai/bim/module/fm/operator.py +++ b/src/bonsai/bonsai/bim/module/fm/operator.py @@ -29,6 +29,7 @@ import bonsai.tool as tool class ExecuteIfcFM(bpy.types.Operator): bl_idname = "bim.execute_ifcfm" bl_label = "Execute IfcFM" + bl_description = "Export IfcFM data as a spreadsheet." file_format: bpy.props.StringProperty() filter_glob: bpy.props.StringProperty(default="*.csv;*.ods;*.xlsx", options={"HIDDEN"}) filepath: bpy.props.StringProperty(subtype="FILE_PATH") @@ -85,6 +86,7 @@ class ExecuteIfcFM(bpy.types.Operator): class SelectFMSpreadsheetFiles(bpy.types.Operator): bl_idname = "bim.select_fm_spreadsheet_files" bl_label = "Select FM Spreadsheet Files" + bl_description = "Select FM spreadsheets to merge." bl_options = {"REGISTER", "UNDO"} filter_glob: bpy.props.StringProperty(default="*.ods;*.xlsx", options={"HIDDEN"}) filepath: bpy.props.StringProperty(subtype="FILE_PATH") @@ -107,6 +109,7 @@ class SelectFMSpreadsheetFiles(bpy.types.Operator): class ExecuteIfcFMFederate(bpy.types.Operator): bl_idname = "bim.execute_ifcfm_federate" bl_label = "Merge IfcFM SpreadSheets" + bl_description = "Merge added IfcFM spreadsheets." filter_glob: bpy.props.StringProperty(default="*.ods;*.xlsx", options={"HIDDEN"}) filepath: bpy.props.StringProperty(subtype="FILE_PATH") diff --git a/src/bonsai/bonsai/bim/module/georeference/operator.py b/src/bonsai/bonsai/bim/module/georeference/operator.py index 94307113e0..edfa9a9054 100644 --- a/src/bonsai/bonsai/bim/module/georeference/operator.py +++ b/src/bonsai/bonsai/bim/module/georeference/operator.py @@ -91,7 +91,7 @@ class ImportPlot(bpy.types.Operator, tool.Ifc.Operator): bl_idname = "bim.import_plot" bl_label = "Import Plot" bl_options = {"REGISTER", "UNDO"} - bl_description = "Import plot" + bl_description = "Import plot from a csv file." filepath: bpy.props.StringProperty(subtype="FILE_PATH") filter_glob: bpy.props.StringProperty(default="*.csv", options={"HIDDEN"}) diff --git a/src/bonsai/bonsai/bim/module/model/sverchok_modifier.py b/src/bonsai/bonsai/bim/module/model/sverchok_modifier.py index 5624797752..149a309baa 100644 --- a/src/bonsai/bonsai/bim/module/model/sverchok_modifier.py +++ b/src/bonsai/bonsai/bim/module/model/sverchok_modifier.py @@ -184,6 +184,7 @@ class UpdateDataFromSverchok(bpy.types.Operator, tool.Ifc.Operator): class ImportSverchokGraph(bpy.types.Operator, tool.Ifc.Operator): bl_idname = "bim.import_sverchok_graph" bl_label = "Import Sverchok Graph" + bl_description = "Import Sverchok graph from a json file." bl_options = {"REGISTER"} filepath: bpy.props.StringProperty( @@ -226,6 +227,7 @@ class ImportSverchokGraph(bpy.types.Operator, tool.Ifc.Operator): class ExportSverchokGraph(bpy.types.Operator, tool.Ifc.Operator): bl_idname = "bim.export_sverchok_graph" bl_label = "Export Sverchok Graph" + bl_description = "Export Sverchok graph to a json file." bl_options = {"REGISTER"} filepath: bpy.props.StringProperty( diff --git a/src/bonsai/bonsai/bim/module/patch/operator.py b/src/bonsai/bonsai/bim/module/patch/operator.py index 0c2c868f7a..bbd521ffd4 100644 --- a/src/bonsai/bonsai/bim/module/patch/operator.py +++ b/src/bonsai/bonsai/bim/module/patch/operator.py @@ -34,6 +34,7 @@ if TYPE_CHECKING: class SelectIfcPatchInput(bpy.types.Operator): bl_idname = "bim.select_ifc_patch_input" bl_label = "Select IFC Patch Input" + bl_description = "Select filepath for IFC patch input." bl_options = {"REGISTER", "UNDO"} filter_glob: bpy.props.StringProperty(default="*.ifc;*.ifcZIP;*.ifcXML", options={"HIDDEN"}) filepath: bpy.props.StringProperty(subtype="FILE_PATH") @@ -51,6 +52,7 @@ class SelectIfcPatchInput(bpy.types.Operator): class SelectIfcPatchOutput(bpy.types.Operator): bl_idname = "bim.select_ifc_patch_output" bl_label = "Select IFC Patch Output" + bl_description = "Select filepath for IFC patch output." bl_options = {"REGISTER", "UNDO"} filename_ext = ".ifc" filepath: bpy.props.StringProperty(subtype="FILE_PATH") diff --git a/src/bonsai/bonsai/bim/module/project/operator.py b/src/bonsai/bonsai/bim/module/project/operator.py index 52333a5120..936a532d1e 100644 --- a/src/bonsai/bonsai/bim/module/project/operator.py +++ b/src/bonsai/bonsai/bim/module/project/operator.py @@ -1547,6 +1547,8 @@ class SelectLinkHandle(bpy.types.Operator): class ExportIFC(bpy.types.Operator): bl_idname = "bim.save_project" bl_label = "Save IFC" + # Prevents crash on Blender 4.4.0. + bl_description = "Save active IFC file by the provided filepath." bl_options = {"REGISTER", "UNDO"} filename_ext = ".ifc" filter_glob: bpy.props.StringProperty(default="*.ifc;*.ifczip;*.ifcxml;*.ifcjson", options={"HIDDEN"}) diff --git a/src/bonsai/bonsai/bim/module/style/operator.py b/src/bonsai/bonsai/bim/module/style/operator.py index 0ead9b6751..ea20f25be0 100644 --- a/src/bonsai/bonsai/bim/module/style/operator.py +++ b/src/bonsai/bonsai/bim/module/style/operator.py @@ -276,6 +276,7 @@ class SetAssetMaterialToExternalStyle(bpy.types.Operator): class BrowseExternalStyle(bpy.types.Operator): bl_idname = "bim.browse_external_style" bl_label = "Browse External Style" + bl_description = "Select filepath for an external style." bl_options = {"REGISTER", "UNDO"} filepath: bpy.props.StringProperty( @@ -540,6 +541,7 @@ class SelectByStyle(bpy.types.Operator): class ChooseTextureMapPath(bpy.types.Operator): bl_idname = "bim.choose_texture_map_path" bl_label = "Choose Texture Map Path" + bl_description = "Select filepath for a texture map." bl_options = {"REGISTER", "UNDO", "INTERNAL"} texture_map_index: bpy.props.IntProperty(default=-1, options={"SKIP_SAVE"}) diff --git a/src/bonsai/bonsai/bim/module/tester/operator.py b/src/bonsai/bonsai/bim/module/tester/operator.py index a438bdcfb5..f653404d78 100644 --- a/src/bonsai/bonsai/bim/module/tester/operator.py +++ b/src/bonsai/bonsai/bim/module/tester/operator.py @@ -189,6 +189,7 @@ class SelectFailedEntities(bpy.types.Operator): class ExportBcf(bpy.types.Operator): bl_idname = "bim.export_bcf" bl_label = "Export BCF" + bl_description = "Save ifctester BCF report by the provided filepath." bl_options = {"REGISTER", "UNDO"} filter_glob: bpy.props.StringProperty(default="*.bcf", options={"HIDDEN"}) filepath: bpy.props.StringProperty(subtype="FILE_PATH")