From 987dd552455e27b7296233f0ac569690c2e50e21 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 16 Apr 2012 09:55:54 +0000 Subject: Fix #30958: Right click menu and add shortcut for importers/exporters doesn't work 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 | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index ddbacc6b747..af56211a4e3 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -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 */ -- cgit v1.2.3