Keymap: move weight & vertex paint handling before pose mode
authorCampbell Barton <ideasman42@gmail.com>
Sat, 15 Feb 2020 07:50:52 +0000 (18:50 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 15 Feb 2020 07:59:46 +0000 (18:59 +1100)
This is needed so pose keymap doesn't override weight paint,
which currently prevents the weight paint context menu from showing.

Logically pose mode is secondary when used in combination with
weight paint, so evaluate it afterwards.

Also move vertex paint keymap since they have a lot in common,
it's simpler to keep them evaluated at the same place.

Resolves T73384

source/blender/editors/space_view3d/space_view3d.c

index 902df9ef89e4298b6983a203ce0053683113ba4c..9d84309d222d784bcec382fdd4a9f9cb17b2c254 100644 (file)
@@ -367,6 +367,13 @@ static void view3d_main_region_init(wmWindowManager *wm, ARegion *ar)
   keymap = WM_keymap_ensure(wm->defaultconf, "Weight Paint Vertex Selection", 0, 0);
   WM_event_add_keymap_handler(&ar->handlers, keymap);
 
+  /* Before 'Pose' so weight paint menus aren't overridden by pose menus. */
+  keymap = WM_keymap_ensure(wm->defaultconf, "Weight Paint", 0, 0);
+  WM_event_add_keymap_handler(&ar->handlers, keymap);
+
+  keymap = WM_keymap_ensure(wm->defaultconf, "Vertex Paint", 0, 0);
+  WM_event_add_keymap_handler(&ar->handlers, keymap);
+
   /* pose is not modal, operator poll checks for this */
   keymap = WM_keymap_ensure(wm->defaultconf, "Pose", 0, 0);
   WM_event_add_keymap_handler(&ar->handlers, keymap);
@@ -383,12 +390,6 @@ static void view3d_main_region_init(wmWindowManager *wm, ARegion *ar)
   keymap = WM_keymap_ensure(wm->defaultconf, "Image Paint", 0, 0);
   WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-  keymap = WM_keymap_ensure(wm->defaultconf, "Vertex Paint", 0, 0);
-  WM_event_add_keymap_handler(&ar->handlers, keymap);
-
-  keymap = WM_keymap_ensure(wm->defaultconf, "Weight Paint", 0, 0);
-  WM_event_add_keymap_handler(&ar->handlers, keymap);
-
   keymap = WM_keymap_ensure(wm->defaultconf, "Sculpt", 0, 0);
   WM_event_add_keymap_handler(&ar->handlers, keymap);