I can add an item My Item using the script at the bottom.
Currently I only know how to add the item to the same flat list in the Export category like in the script at the bottom, but I would like to know how to group them into another sub category Group of Items. Is this even possible? The list is very long and I don't want it to be part of the flat list with the default types. I would like this:
Or maybe I can add it alongside File > Import and File > Export as type File > Export Group 2 group, but how to do that?
Here's the script:
import bpy
class SimpleExportOperator(bpy.types.Operator):
bl_idname = "export.simple_operator"
bl_label = "Simple Export Operator"
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context):
self.report({'INFO'}, "Executing Simple Export Operator")
return {'FINISHED'}
def menu_func_export_my_item(self, context):
self.layout.operator(SimpleExportOperator.bl_idname, text="My Item")
def register():
bpy.utils.register_class(SimpleExportOperator)
bpy.types.TOPBAR_MT_file_export.append(menu_func_export_my_item)
def unregister():
bpy.utils.unregister_class(SimpleExportOperator)
bpy.types.TOPBAR_MT_file_export.remove(menu_func_export_my_item)
if __name__ == "__main__":
register()