svn merge ^/trunk/blender -r47023:HEAD
[blender-staging.git] / source / blender / editors / object / object_ops.c
index 0c50ab5848730d181db38775cab032e508938cc2..addc6cd4277ded4bb53b75484a4eb6f84f3e0c02 100644 (file)
@@ -298,7 +298,8 @@ void ED_keymap_object(wmKeyConfig *keyconf)
        keymap->poll = object_mode_poll;
        
        /* object mode supports PET now */
-       ED_object_generic_keymap(keyconf, keymap, 1);
+       ED_keymap_proportional_cycle(keyconf, keymap);
+       ED_keymap_proportional_obmode(keyconf, keymap);
 
        WM_keymap_add_item(keymap, "VIEW3D_OT_game_start", PKEY, KM_PRESS, 0, 0);
 
@@ -421,41 +422,49 @@ 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, 2);
+       ED_keymap_proportional_cycle(keyconf, keymap);
+       ED_keymap_proportional_editmode(keyconf, keymap, FALSE);
 }
 
-void ED_object_generic_keymap(struct wmKeyConfig *UNUSED(keyconf), struct wmKeyMap *keymap, int do_pet)
+void ED_keymap_proportional_cycle(struct wmKeyConfig *UNUSED(keyconf), struct wmKeyMap *keymap)
 {
        wmKeyMapItem *kmi;
 
-       /* used by mesh, curve & lattice only */
-       if (do_pet) {
-               /* context ops */
-               kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_enum", OKEY, KM_PRESS, KM_SHIFT, 0);
-               RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_edit_falloff");
-
-               // Object mode
-               if (do_pet == TRUE) {
-
-                       kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", OKEY, KM_PRESS, 0, 0);
-                       RNA_string_set(kmi->ptr, "data_path", "tool_settings.use_proportional_edit_objects");
-
-               }
-               else { // Edit mode
-
-                       kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", OKEY, KM_PRESS, 0, 0);
-                       RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_edit");
-                       RNA_string_set(kmi->ptr, "value_1", "DISABLED");
-                       RNA_string_set(kmi->ptr, "value_2", "ENABLED");
-
-                       /* for modes/object types that allow 'connected' mode, add the Alt O key */
-                       if (do_pet == 3) {
-                               kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", OKEY, KM_PRESS, KM_ALT, 0);
-                               RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_edit");
-                               RNA_string_set(kmi->ptr, "value_1", "DISABLED");
-                               RNA_string_set(kmi->ptr, "value_2", "CONNECTED");
-                       }
-               }
-       }
+       kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_enum", OKEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_edit_falloff");
+}
+
+void ED_keymap_proportional_obmode(struct wmKeyConfig *UNUSED(keyconf), struct wmKeyMap *keymap)
+{
+       wmKeyMapItem *kmi;
+
+       kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", OKEY, KM_PRESS, 0, 0);
+       RNA_string_set(kmi->ptr, "data_path", "tool_settings.use_proportional_edit_objects");
+}
+
+void ED_keymap_proportional_maskmode(struct wmKeyConfig *UNUSED(keyconf), struct wmKeyMap *keymap)
+{
+       wmKeyMapItem *kmi;
+
+       kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", OKEY, KM_PRESS, 0, 0);
+       RNA_string_set(kmi->ptr, "data_path", "tool_settings.use_proportional_edit_mask");
 }
 
+void ED_keymap_proportional_editmode(struct wmKeyConfig *UNUSED(keyconf), struct wmKeyMap *keymap,
+                                     const short do_connected)
+{
+       wmKeyMapItem *kmi;
+
+       kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", OKEY, KM_PRESS, 0, 0);
+       RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_edit");
+       RNA_string_set(kmi->ptr, "value_1", "DISABLED");
+       RNA_string_set(kmi->ptr, "value_2", "ENABLED");
+
+       /* for modes/object types that allow 'connected' mode, add the Alt O key */
+       if (do_connected) {
+               kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", OKEY, KM_PRESS, KM_ALT, 0);
+               RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_edit");
+               RNA_string_set(kmi->ptr, "value_1", "DISABLED");
+               RNA_string_set(kmi->ptr, "value_2", "CONNECTED");
+       }
+}