Import menu popup

I want to create shortcut for import menu.
At this moment if you want to import something into scene you must navigate into “file” menu. It would be a lot easier to show import options by shortcut, for example pressing Ctrl+F1 and displaying this:

I tried to bind “wm.call_menu” “INFO_MT_file_import” inside Input Preferences.


And it partially worked and shows popup like on first screenshot. But if I press any import menu item, for example “Wavefront (.obj)” it display an error:

Traceback (most recent call last):
File “C:\Program Files\Steam\SteamApps\common\Blender\2.78\scripts\addons\io_scene_obj_init_.py”, line 147, in execute
return import_obj.load(context, **keywords)
File “C:\Program Files\Steam\SteamApps\common\Blender\2.78\scripts\addons\io_scene_obj\import_obj.py”, line 945, in load
float_func = get_float_func(filepath)
File “C:\Program Files\Steam\SteamApps\common\Blender\2.78\scripts\addons\io_scene_obj\import_obj.py”, line 866, in get_float_func
file = open(filepath, ‘rb’)
FileNotFoundError: [Errno 2] No such file or directory: ‘’

location: <unknown location>:-1

So I think I have to create an addon and mess with scripting.
I would be glad if someone give me basic ideas what function should I use to show such popup.

Don’t know. One thing that does work is doing the entire ‘File’ menu. Change your “INFO_MT_file_import” to “INFO_MT_file”. It might have to do with a menu being inside a menu.

(This is a 2-year-old thread)


The reason this is happening is because of the context that those import operators are running in. When you use wm.call_menu, they’re being executed and expect a path to be supplied to them. When they’re invoked, they bring up that file picking dialog. Read more in the second note in here.

That context is only defined in the parent menu (“INFO_MT_file”), like @AFWS observed. That’s why it works that way and not calling the submenu directly.
The parent menu has a line with layout.operator_context = 'INVOKE_DEFAULT' and then proceeds to declare the layout.menu(...) items, in that order.

The easiest solution for day-to-day work would be to just search for those import operators manually with the Search Menu (Space key in 2.79, Space/F3 in 2.80). Typing “import” will only list them.

Yes, I gave up with blender shortcuts and manually recreated panel with pie menu editor