Fix [#21542] Clear origin shortkey Alt+O in object mode doesn't work
authorMatt Ebb <matt@mke3.net>
Mon, 29 Mar 2010 07:07:20 +0000 (07:07 +0000)
committerMatt Ebb <matt@mke3.net>
Mon, 29 Mar 2010 07:07:20 +0000 (07:07 +0000)
source/blender/editors/curve/curve_ops.c
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/object/object_ops.c
source/blender/editors/uvedit/uvedit_ops.c

index 18652bf3716109bb84f18c92bda0b9d7a5554e12..a72b7f68dab2c91530a5f20af4f212b73e683dde 100644 (file)
@@ -216,6 +216,6 @@ void ED_keymap_curve(wmKeyConfig *keyconf)
        /* menus */
        WM_keymap_add_menu(keymap, "VIEW3D_MT_hook", HKEY, KM_PRESS, KM_CTRL, 0);
 
-       ED_object_generic_keymap(keyconf, keymap, TRUE);
+       ED_object_generic_keymap(keyconf, keymap, 2);
 }
 
index 5b187b10b7d551832fe8ce69f583488d75e38d17..5351a2b5a2ddfd0b75b6544919bbccc6186d4105 100644 (file)
@@ -309,6 +309,6 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
        WM_keymap_add_menu(keymap, "VIEW3D_MT_uv_map", UKEY, KM_PRESS, 0, 0);
        WM_keymap_add_menu(keymap, "VIEW3D_MT_vertex_group", GKEY, KM_PRESS, KM_CTRL, 0);
        
-       ED_object_generic_keymap(keyconf, keymap, TRUE);
+       ED_object_generic_keymap(keyconf, keymap, 2);
 }
 
index 8ec33f676caa721600b81ee6c3529488bce63604..2ff99bac1c59be260b6d693bde501557220ea28f 100644 (file)
@@ -274,7 +274,7 @@ void ED_keymap_object(wmKeyConfig *keyconf)
        keymap->poll= object_mode_poll;
        
        /* object mode supports PET now */
-       ED_object_generic_keymap(keyconf, keymap, TRUE);
+       ED_object_generic_keymap(keyconf, keymap, 1);
 
        WM_keymap_add_item(keymap, "VIEW3D_OT_game_start", PKEY, KM_PRESS, 0, 0);
 
@@ -362,7 +362,7 @@ void ED_keymap_object(wmKeyConfig *keyconf)
                /* menus */
        WM_keymap_add_menu(keymap, "VIEW3D_MT_hook", HKEY, KM_PRESS, KM_CTRL, 0);
 
-       ED_object_generic_keymap(keyconf, keymap, TRUE);
+       ED_object_generic_keymap(keyconf, keymap, 1);
 }
 
 void ED_object_generic_keymap(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap, int do_pet)
@@ -370,7 +370,7 @@ void ED_object_generic_keymap(struct wmKeyConfig *keyconf, struct wmKeyMap *keym
        wmKeyMapItem *kmi;
 
        /* used by mesh, curve & lattice only */
-       if(do_pet) {
+       if(do_pet > 0) {
                /* context ops */
                kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_enum", OKEY, KM_PRESS, KM_SHIFT, 0);
                RNA_string_set(kmi->ptr, "path", "tool_settings.proportional_editing_falloff");
@@ -380,10 +380,13 @@ void ED_object_generic_keymap(struct wmKeyConfig *keyconf, struct wmKeyMap *keym
                RNA_string_set(kmi->ptr, "value_1", "DISABLED");
                RNA_string_set(kmi->ptr, "value_2", "ENABLED");
 
-               kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", OKEY, KM_PRESS, KM_ALT, 0);
-               RNA_string_set(kmi->ptr, "path", "tool_settings.proportional_editing");
-               RNA_string_set(kmi->ptr, "value_1", "DISABLED");
-               RNA_string_set(kmi->ptr, "value_2", "CONNECTED");
+               /* for modes/object types that allow 'conencted' mode, add the Alt O key */
+               if (do_pet > 1) {
+                       kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", OKEY, KM_PRESS, KM_ALT, 0);
+                       RNA_string_set(kmi->ptr, "path", "tool_settings.proportional_editing");
+                       RNA_string_set(kmi->ptr, "value_1", "DISABLED");
+                       RNA_string_set(kmi->ptr, "value_2", "CONNECTED");
+               }
        }
 }
 
index fe0478a2a154510d9d8bb4621610d0a20d380764..3cfbac07e496ac4dab963af149affbd10e338a17 100644 (file)
@@ -3243,7 +3243,7 @@ void ED_keymap_uvedit(wmKeyConfig *keyconf)
        /* menus */
        WM_keymap_add_menu(keymap, "IMAGE_MT_uvs_snap", SKEY, KM_PRESS, KM_SHIFT, 0);
 
-       ED_object_generic_keymap(keyconf, keymap, TRUE);
+       ED_object_generic_keymap(keyconf, keymap, 1);
 
        transform_keymap_for_space(keyconf, keymap, SPACE_IMAGE);
 }