Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-04-17 19:40:04 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-04-17 19:40:04 +0400
commit8ae502ae99be5171d8da6643b5bbeab0794d3d7c (patch)
treee059f6399d1399b91c172a1c307ee47592d6eaad /source/blender/makesrna/intern/rna_wm_api.c
parent3f9fce6542e92f4a62af326572bccd3a4cbcfce1 (diff)
Fix #30977: error loading modal keymaps from keyconfiguration presets.
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_wm_api.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c
index bad122ab761..9b3634bc8ac 100644
--- a/source/blender/makesrna/intern/rna_wm_api.c
+++ b/source/blender/makesrna/intern/rna_wm_api.c
@@ -120,16 +120,6 @@ static wmKeyMapItem *rna_KeyMap_item_new_modal(wmKeyMap *km, ReportList *reports
return NULL;
}
- if (!km->modal_items) {
- BKE_report(reports, RPT_ERROR, "No property values defined");
- return NULL;
- }
-
-
- if (RNA_enum_value_from_id(km->modal_items, propvalue_str, &propvalue) == 0) {
- BKE_report(reports, RPT_WARNING, "Property value not in enumeration");
- }
-
if (shift) modifier |= KM_SHIFT;
if (ctrl) modifier |= KM_CTRL;
if (alt) modifier |= KM_ALT;
@@ -137,6 +127,13 @@ static wmKeyMapItem *rna_KeyMap_item_new_modal(wmKeyMap *km, ReportList *reports
if (any) modifier = KM_ANY;
+ /* not initialized yet, do delayed lookup */
+ if (!km->modal_items)
+ return WM_modalkeymap_add_item_str(km, type, value, modifier, keymodifier, propvalue_str);
+
+ if (RNA_enum_value_from_id(km->modal_items, propvalue_str, &propvalue) == 0)
+ BKE_report(reports, RPT_WARNING, "Property value not in enumeration");
+
return WM_modalkeymap_add_item(km, type, value, modifier, keymodifier, propvalue);
}