[Bf-blender-cvs] [ed9273b08b9] master: Fix T63852: Invalid keymaps written

Campbell Barton noreply at git.blender.org
Wed May 22 05:59:37 CEST 2019


Commit: ed9273b08b9a6c0651f74ed9fe267d5ecf66d4c4
Author: Campbell Barton
Date:   Wed May 22 13:22:45 2019 +1000
Branches: master
https://developer.blender.org/rBed9273b08b9a6c0651f74ed9fe267d5ecf66d4c4

Fix T63852: Invalid keymaps written

Track-pad & NDOF events were using KM_NOTHING which wasn't included in
the RNA enum, causing the value to be an empty string in exported key-map
(which then failed to load back).

Add back 'Nothing' value, keep it last since it's not used often.

===================================================================

M	source/blender/makesrna/intern/rna_wm.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 4a19dab9180..14994340ad3 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -49,6 +49,8 @@ static const EnumPropertyItem event_keymouse_value_items[] = {
     {KM_CLICK, "CLICK", 0, "Click", ""},
     {KM_DBL_CLICK, "DOUBLE_CLICK", 0, "Double Click", ""},
     {KM_CLICK_DRAG, "CLICK_DRAG", 0, "Click Drag", ""},
+    /* Used for NDOF and trackpad events. */
+    {KM_NOTHING, "NOTHING", 0, "Nothing", ""},
     {0, NULL, 0, NULL, NULL},
 };
 
@@ -382,7 +384,6 @@ const EnumPropertyItem rna_enum_event_type_items[] = {
 
 const EnumPropertyItem rna_enum_event_value_items[] = {
     {KM_ANY, "ANY", 0, "Any", ""},
-    {KM_NOTHING, "NOTHING", 0, "Nothing", ""},
     {KM_PRESS, "PRESS", 0, "Press", ""},
     {KM_RELEASE, "RELEASE", 0, "Release", ""},
     {KM_CLICK, "CLICK", 0, "Click", ""},
@@ -396,6 +397,7 @@ const EnumPropertyItem rna_enum_event_value_items[] = {
     {EVT_GESTURE_SW, "SOUTH_WEST", 0, "South-West", ""},
     {EVT_GESTURE_W, "WEST", 0, "West", ""},
     {EVT_GESTURE_NW, "NORTH_WEST", 0, "North-West", ""},
+    {KM_NOTHING, "NOTHING", 0, "Nothing", ""},
     {0, NULL, 0, NULL, NULL},
 };



More information about the Bf-blender-cvs mailing list