I know that I can extend menus with modifications of:

def menu_draw(self, context):


which would add an item to the File menu. Question is, how do I add items to submenus? For example, how would I add an item to File > Export?

I tried bpy.types.INFO_MT_file.Export.append(menu_draw), it does not work.


1 Answer 1


You were close!

A good way to find this kind of stuff is to open the source of any of the addons that add themselves to the export submenu. For our purposes you could look at the DXF exporter script.

from the __init__.py file in scripts/addons/io_export_dxf


This information is available as a template too from:

Text Editor -> Templates -> Python -> Operator File Export

Clicking the menu item will add and show operator_file_export.py in the Text Editor.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .