[Bf-blender-cvs] [851ea20] master: Separate proportional editing options for graph and action editor.

Antony Riakiotakis noreply at git.blender.org
Thu Apr 9 18:30:28 CEST 2015


Commit: 851ea206d05b4d91423bc754ab2cc4bb0d1f6f38
Author: Antony Riakiotakis
Date:   Thu Apr 9 18:29:58 2015 +0200
Branches: master
https://developer.blender.org/rB851ea206d05b4d91423bc754ab2cc4bb0d1f6f38

Separate proportional editing options for graph and action editor.

===================================================================

M	release/scripts/startup/bl_ui/space_dopesheet.py
M	release/scripts/startup/bl_ui/space_graph.py
M	source/blender/editors/space_action/action_ops.c
M	source/blender/editors/space_graph/graph_ops.c
M	source/blender/editors/transform/transform.c
M	source/blender/editors/transform/transform_generics.c
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesrna/intern/rna_scene.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py
index 843cf41..7994311 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 4c3f4bb..485bd27 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 752863f..0ecd8b3 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 4b55a16..5ca7d15 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 0d5e496..ddd2df8 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 27a072c..b27f7c5 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 250bfe8..ed63aef 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 3bcac9c..696f1b9 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);




More information about the Bf-blender-cvs mailing list