Fix #30958: Right click menu and add shortcut for importers/exporters doesn't work
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 16 Apr 2012 09:55:54 +0000 (09:55 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 16 Apr 2012 09:55:54 +0000 (09:55 +0000)
This was caused by how keymap is guessing for importer/exporter:

- In some cases if detected wrong keymap like for IMPORT_CURVE_OT_svg
  curve editing context was used because of CURVE_OT substring in
  operator name
- In other cases no keymap was detected because of substrings
  WM_keymap_guess_opname cheched.

Fixed by using Window keymap for any operator with EXPORT_/IMPORT_ substring
which seems to detect importer/exporter operator and only them nicely.

source/blender/windowmanager/intern/wm_keymap.c

index ddbacc6b747cdc8223f33607ab3feff563e41d07..af56211a4e323fb15d9204c0cb64e25a93131ab8 100644 (file)
@@ -1190,6 +1190,10 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname)
        else if (strstr(opname, "MARKER_OT")) {
                km = WM_keymap_find_all(C, "Markers", 0, 0);
        }
+       /* Import/Export*/
+       else if (strstr(opname, "IMPORT_") || strstr(opname, "EXPORT_")) {
+               km = WM_keymap_find_all(C, "Window", 0, 0);
+       }
        
        
        /* 3D View */