diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-06-06 17:35:43 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-06-06 17:35:43 +0400 |
commit | 4d254f23ca5964147823307e3bff8d7c3f663e00 (patch) | |
tree | c761e4f1c01eb21a6a498403a9e0950dd8ec29de | |
parent | 111b0bf698fccb6c877aa139aed525e005caf8dd (diff) |
Keymaps: fix keymap items created in python being added with the python
operator names instead of the internal names. This wasn't really noticeable,
expect that it broke automatically looking up shortcuts for display in menus.
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index fc3039c8752..7ea4701dec3 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -1048,6 +1048,7 @@ static StructRNA* rna_MacroOperator_refine(PointerRNA *opr) static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, const char *idname, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier) { // wmWindowManager *wm = CTX_wm_manager(C); + char idname_bl[OP_MAX_TYPENAME]; int modifier= 0; /* only on non-modal maps */ @@ -1056,6 +1057,8 @@ static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, cons return NULL; } + WM_operator_bl_idname(idname_bl, idname); + if(shift) modifier |= KM_SHIFT; if(ctrl) modifier |= KM_CTRL; if(alt) modifier |= KM_ALT; @@ -1063,7 +1066,7 @@ static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, cons if(any) modifier = KM_ANY; - return WM_keymap_add_item(km, idname, type, value, modifier, keymodifier); + return WM_keymap_add_item(km, idname_bl, type, value, modifier, keymodifier); } static wmKeyMapItem *rna_KeyMap_item_new_modal(wmKeyMap *km, bContext *C, ReportList *reports, const char *propvalue_str, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier) |