2.5 - Code shuffling
authorJoshua Leung <aligorith@gmail.com>
Sat, 22 Aug 2009 02:53:14 +0000 (02:53 +0000)
committerJoshua Leung <aligorith@gmail.com>
Sat, 22 Aug 2009 02:53:14 +0000 (02:53 +0000)
Moved WeightPaint/VertexPaint toggling hotkeys to the same place that the ones for PoseMode/EditMode are defined. This means that the hotkey for toggling PoseMode works again (instead of being overwritten by WeightPaint).

source/blender/editors/object/object_ops.c
source/blender/editors/space_view3d/view3d_ops.c

index 6f1a3b5f6cbfc603ea5ee05431fcda7016be6366..239b162c14fa38adeb71e054ff29a26c95e12950 100644 (file)
@@ -167,10 +167,19 @@ void ED_operatortypes_object(void)
 void ED_keymap_object(wmWindowManager *wm)
 {
        ListBase *keymap= WM_keymap_listbase(wm, "Object Non-modal", 0, 0);
+       wmKeymapItem *kmi;
        
        /* Note: this keymap works disregarding mode */
        WM_keymap_add_item(keymap, "OBJECT_OT_editmode_toggle", TABKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "OBJECT_OT_posemode_toggle", TABKEY, KM_PRESS, KM_CTRL, 0);
+       
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", VKEY, KM_PRESS, 0, 0);
+               RNA_enum_set(kmi->ptr, "mode", OB_MODE_VERTEX_PAINT);
+               RNA_boolean_set(kmi->ptr, "toggle", 1);
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0);
+               RNA_enum_set(kmi->ptr, "mode", OB_MODE_WEIGHT_PAINT);
+               RNA_boolean_set(kmi->ptr, "toggle", 1);
+       
        WM_keymap_add_item(keymap, "OBJECT_OT_center_set", CKEY, KM_PRESS, KM_ALT|KM_SHIFT|KM_CTRL, 0);
 
        /* Note: this keymap gets disabled in non-objectmode,  */
index b0eabae3f5df47905a03e0e03e87522fc9e741c5..929272bc0664d1bc7014448c8a2264dbeaa5be25 100644 (file)
@@ -106,13 +106,6 @@ void view3d_keymap(wmWindowManager *wm)
        ListBase *keymap= WM_keymap_listbase(wm, "View3D Generic", SPACE_VIEW3D, 0);
        wmKeymapItem *km;
        
-       km = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", VKEY, KM_PRESS, 0, 0);
-       RNA_enum_set(km->ptr, "mode", OB_MODE_VERTEX_PAINT);
-       RNA_boolean_set(km->ptr, "toggle", 1);
-       km = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0);
-       RNA_enum_set(km->ptr, "mode", OB_MODE_WEIGHT_PAINT);
-       RNA_boolean_set(km->ptr, "toggle", 1);
-       
        WM_keymap_add_item(keymap, "VIEW3D_OT_properties", NKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "VIEW3D_OT_toolbar", TKEY, KM_PRESS, 0, 0);