diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-04-09 19:29:58 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-04-09 19:30:14 +0300 |
commit | 851ea206d05b4d91423bc754ab2cc4bb0d1f6f38 (patch) | |
tree | 1ed416c189aa41c5d1f9e71b00855e514f343e2f | |
parent | cca4405437363bd1cb3d8ee9a77691fd8225d76f (diff) |
Separate proportional editing options for graph and action editor.
-rw-r--r-- | release/scripts/startup/bl_ui/space_dopesheet.py | 8 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_graph.py | 9 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_ops.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_ops.c | 6 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.c | 6 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 7 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 12 |
8 files changed, 41 insertions, 18 deletions
diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py index 843cf41b07c..799431118fb 100644 --- a/release/scripts/startup/bl_ui/space_dopesheet.py +++ b/release/scripts/startup/bl_ui/space_dopesheet.py @@ -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': diff --git a/release/scripts/startup/bl_ui/space_graph.py b/release/scripts/startup/bl_ui/space_graph.py index 4c3f4bb695e..485bd271060 100644 --- a/release/scripts/startup/bl_ui/space_graph.py +++ b/release/scripts/startup/bl_ui/space_graph.py @@ -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) diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c index 752863f86e0..0ecd8b31d37 100644 --- a/source/blender/editors/space_action/action_ops.c +++ b/source/blender/editors/space_action/action_ops.c @@ -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); diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index 4b55a16b767..5ca7d156a1e 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -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); diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 0d5e496ee07..ddd2df80d1a 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -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); diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 27a072c301b..b27f7c5ae12 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -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); diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 250bfe85ec2..ed63aefa4df 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -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 */ diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 3bcac9c6696..696f1b996d4 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -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); |