Separate proportional edit setting between edit and object mode. They are now used...
[blender-staging.git] / source / blender / editors / object / object_ops.c
index e1ea7924916490f3e788b98070c77f986991fa16..610a82d964c997f3eed27978e181c7662b2f5046 100644 (file)
@@ -364,7 +364,10 @@ void ED_keymap_object(wmKeyConfig *keyconf)
                RNA_int_set(kmi->ptr, "level", i);
        }
 
                RNA_int_set(kmi->ptr, "level", i);
        }
 
-       /* Lattice -------------------------------------------------------------------- */
+       /* ############################################################################ */
+       /* ################################ LATTICE ################################### */
+       /* ############################################################################ */
+
        keymap= WM_keymap_find(keyconf, "Lattice", 0, 0);
        keymap->poll= ED_operator_editlattice;
 
        keymap= WM_keymap_find(keyconf, "Lattice", 0, 0);
        keymap->poll= ED_operator_editlattice;
 
@@ -375,7 +378,7 @@ void ED_keymap_object(wmKeyConfig *keyconf)
                /* menus */
        WM_keymap_add_menu(keymap, "VIEW3D_MT_hook", HKEY, KM_PRESS, KM_CTRL, 0);
 
                /* menus */
        WM_keymap_add_menu(keymap, "VIEW3D_MT_hook", HKEY, KM_PRESS, KM_CTRL, 0);
 
-       ED_object_generic_keymap(keyconf, keymap, 1);
+       ED_object_generic_keymap(keyconf, keymap, 2);
 }
 
 void ED_object_generic_keymap(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap, int do_pet)
 }
 
 void ED_object_generic_keymap(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap, int do_pet)
@@ -383,22 +386,31 @@ void ED_object_generic_keymap(struct wmKeyConfig *keyconf, struct wmKeyMap *keym
        wmKeyMapItem *kmi;
 
        /* used by mesh, curve & lattice only */
        wmKeyMapItem *kmi;
 
        /* used by mesh, curve & lattice only */
-       if(do_pet > 0) {
+       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_editing_falloff");
 
                /* 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_editing_falloff");
 
-               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_editing");
-               RNA_string_set(kmi->ptr, "value_1", "DISABLED");
-               RNA_string_set(kmi->ptr, "value_2", "ENABLED");
+               // Object mode
+               if (do_pet == 1) {
+
+                       kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", OKEY, KM_PRESS, 0, 0);
+                       RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_editing_objects");
+
+               } else { // Edit mode
 
 
-               /* 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);
+                       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_editing");
                        RNA_string_set(kmi->ptr, "value_1", "DISABLED");
                        RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_editing");
                        RNA_string_set(kmi->ptr, "value_1", "DISABLED");
-                       RNA_string_set(kmi->ptr, "value_2", "CONNECTED");
+                       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_editing");
+                               RNA_string_set(kmi->ptr, "value_1", "DISABLED");
+                               RNA_string_set(kmi->ptr, "value_2", "CONNECTED");
+                       }
                }
        }
 }
                }
        }
 }