Is there a way to customize the export button label in the File Dialog? Currently, the button always uses the bl_label of the operator, but I’d like to set a different label specifically for the export button while keeping bl_label unchanged for the F3 search. Is there a way to achieve this?
import bpy
class EXPORT_OT_TestExportOperator(bpy.types.Operator):
bl_idname = "export.test_export_operator"
bl_label = "I only need this label for F3 search but not for the export button" # This text will appear as the file dialog button
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
def execute(self, context):
return {'FINISHED'}
def invoke(self, context, event):
context.window_manager.fileselect_add(self)
# Attempts to override/change button label (this doesn't work)
self.bl_label = "Custom Export Button"
context.window_manager.operators[-1].bl_label = "Custom Export Button"
return {'RUNNING_MODAL'}
def menu_func_export(self, context):
self.layout.operator(EXPORT_OT_TestExportOperator.bl_idname, text="Test Export Issue")
def register():
bpy.utils.register_class(EXPORT_OT_TestExportOperator)
bpy.types.TOPBAR_MT_file_export.append(menu_func_export)
def unregister():
bpy.types.TOPBAR_MT_file_export.remove(menu_func_export)
bpy.utils.unregister_class(EXPORT_OT_TestExportOperator)
if __name__ == "__main__":
register()
Test Export Issuelabel can be used for theF3search. $\endgroup$