Separate proportional editing options for graph and action editor.
authorAntony Riakiotakis <kalast@gmail.com>
Thu, 9 Apr 2015 16:29:58 +0000 (18:29 +0200)
committerAntony Riakiotakis <kalast@gmail.com>
Thu, 9 Apr 2015 16:30:14 +0000 (18:30 +0200)
release/scripts/startup/bl_ui/space_dopesheet.py
release/scripts/startup/bl_ui/space_graph.py
source/blender/editors/space_action/action_ops.c
source/blender/editors/space_graph/graph_ops.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_generics.c
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/intern/rna_scene.c

index 843cf41b07c6a8e1db45f2819d2e8127653a2d6e..799431118fba04a6acdc9f9dec6aa16aac778f35 100644 (file)
@@ -135,9 +135,11 @@ class DOPESHEET_HT_header(Header):
             dopesheet_filter(layout, context, genericFiltersOnly=True)
 
         row = layout.row(align=True)
-        row.prop(toolsettings, "proportional_edit", icon_only=True)
-        if toolsettings.proportional_edit != 'DISABLED':
-            row.prop(toolsettings, "proportional_edit_falloff", icon_only=True)
+        row.prop(toolsettings, "use_proportional_action",
+                 text="", icon_only=True)
+        if toolsettings.use_proportional_action:
+            row.prop(toolsettings, "proportional_edit_falloff",
+                     text="", icon_only=True)
 
         # Grease Pencil mode doesn't need snapping, as it's frame-aligned only
         if st.mode != 'GPENCIL':
index 4c3f4bb695ee472c14bfe7c0f77038bc4bf51cb3..485bd271060c6771dcd17c82fd387fcaf1afce27 100644 (file)
@@ -48,9 +48,12 @@ class GRAPH_HT_header(Header):
         row.prop(st, "use_auto_normalization", text="Auto")
 
         row = layout.row(align=True)
-        row.prop(toolsettings, "proportional_edit", icon_only=True)
-        if toolsettings.proportional_edit != 'DISABLED':
-            row.prop(toolsettings, "proportional_edit_falloff", icon_only=True)
+
+        row.prop(toolsettings, "use_proportional_ipo",
+                 text="", icon_only=True)
+        if toolsettings.use_proportional_ipo:
+            row.prop(toolsettings, "proportional_edit_falloff",
+                     text="", icon_only=True)
 
         layout.prop(st, "auto_snap", text="")
         layout.prop(st, "pivot_point", icon_only=True)
index 752863f86e0a1d7938a17095b61038f1f355a7c7..0ecd8b31d37d81d8dc8081c7ff0759fb578b8f8e 100644 (file)
@@ -241,10 +241,8 @@ static void action_keymap_keyframes(wmKeyConfig *keyconf, wmKeyMap *keymap)
        /* transform system */
        transform_keymap_for_space(keyconf, keymap, SPACE_ACTION);
        
-       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");
+       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_action");
 
        /* special markers hotkeys for anim editors: see note in definition of this function */
        ED_marker_keymap_animedit_conflictfree(keymap);
index 4b55a16b767b339e8f3490d54895ca1daaa205db..5ca7d156a1e2cc821ad126e187f22214e437fc59 100644 (file)
@@ -608,10 +608,8 @@ static void graphedit_keymap_keyframes(wmKeyConfig *keyconf, wmKeyMap *keymap)
        /* transform system */
        transform_keymap_for_space(keyconf, keymap, SPACE_IPO);
        
-       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");
+       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_ipo");
 
        /* pivot point settings */
        kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", COMMAKEY, KM_PRESS, 0, 0);
index 0d5e496ee07de5c20852290c012f90ee4b429342..ddd2df80d1a5ccdc1f79577cadfb5472e3072ac4 100644 (file)
@@ -1938,7 +1938,11 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
                        if ((prop = RNA_struct_find_property(op->ptr, "proportional")) &&
                            !RNA_property_is_set(op->ptr, prop))
                        {
-                               if (t->obedit)
+                               if (t->spacetype == SPACE_IPO)
+                                       ts->proportional_ipo = proportional;
+                               else if (t->spacetype == SPACE_ACTION)
+                                       ts->proportional_action = proportional;
+                               else if (t->obedit)
                                        ts->proportional = proportional;
                                else if (t->options & CTX_MASK)
                                        ts->proportional_mask = (proportional != PROP_EDIT_OFF);
index 27a072c301bd49b6a7a28c0e1e619e4314435dca..b27f7c5ae125c54aed3b3f4754874a0c4dd9178c 100644 (file)
@@ -1320,8 +1320,11 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
                        /* use settings from scene only if modal */
                        if (t->flag & T_MODAL) {
                                if ((t->options & CTX_NO_PET) == 0) {
-                                       if (ELEM(t->spacetype, SPACE_IPO, SPACE_ACTION)) {
-                                               t->flag |= initTransInfo_edit_pet_to_flag(ts->proportional);
+                                       if (t->spacetype == SPACE_IPO) {
+                                               t->flag |= initTransInfo_edit_pet_to_flag(ts->proportional_ipo);
+                                       }
+                                       else if (t->spacetype == SPACE_ACTION) {
+                                               t->flag |= initTransInfo_edit_pet_to_flag(ts->proportional_action);
                                        }
                                        else if (t->obedit) {
                                                t->flag |= initTransInfo_edit_pet_to_flag(ts->proportional);
index 250bfe85ec2cece7398bacb35dce3bc235168df1..ed63aefa4dfefd5b6c21e845bbf06fb4cbb1ce9d 100644 (file)
@@ -1269,7 +1269,10 @@ typedef struct ToolSettings {
        short snap_flag, snap_target;
        short proportional, prop_mode;
        char proportional_objects; /* proportional edit, object mode */
-       char proportional_mask; /* proportional edit, object mode */
+       char proportional_mask; /* proportional edit, mask editing */
+       char proportional_action; /* proportional edit, action editor */
+       char proportional_ipo; /* proportional edit, graph editor */
+       char pad4[6];
 
        char auto_normalize; /*auto normalizing mode in wpaint*/
        char multipaint; /* paint multiple bones in wpaint */
index 3bcac9c669672e7819a2d230de951d9a1377367c..696f1b996d4da90c0820391e689b72d88e3357d2 100644 (file)
@@ -2168,6 +2168,18 @@ static void rna_def_tool_settings(BlenderRNA  *brna)
        RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
        RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
 
+       prop = RNA_def_property(srna, "use_proportional_action", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "proportional_action", 0);
+       RNA_def_property_ui_text(prop, "Proportional Editing Actions", "Proportional editing in action editor");
+       RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
+       RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
+
+       prop = RNA_def_property(srna, "use_proportional_ipo", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "proportional_ipo", 0);
+       RNA_def_property_ui_text(prop, "Proportional Editing Ipo Curves", "Proportional editing in ipo editor");
+       RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
+       RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
+
        prop = RNA_def_property(srna, "proportional_edit_falloff", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
        RNA_def_property_enum_items(prop, proportional_falloff_items);