[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45082] trunk/blender: Quick Mango request : Adjustable contrast/intensity for unselected F-Curves in

Joshua Leung aligorith at gmail.com
Thu Mar 22 13:19:41 CET 2012


Revision: 45082
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45082
Author:   aligorith
Date:     2012-03-22 12:19:31 +0000 (Thu, 22 Mar 2012)
Log Message:
-----------
Quick Mango request: Adjustable contrast/intensity for unselected F-Curves in
Graph Editor

Under User Preferences -> Editing, there's a new setting "F-Curve Visibility"
which controls the how much F-Curves blend in with the background colour.
Increasing this value makes F-Curves stand out more, at the expense of making it
less obvious which F-Curve is active.

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/space_userpref.py
    trunk/blender/source/blender/editors/interface/resources.c
    trunk/blender/source/blender/editors/space_graph/graph_draw.c
    trunk/blender/source/blender/makesdna/DNA_userdef_types.h
    trunk/blender/source/blender/makesrna/intern/rna_userdef.c

Modified: trunk/blender/release/scripts/startup/bl_ui/space_userpref.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_userpref.py	2012-03-22 09:29:18 UTC (rev 45081)
+++ trunk/blender/release/scripts/startup/bl_ui/space_userpref.py	2012-03-22 12:19:31 UTC (rev 45082)
@@ -304,6 +304,11 @@
         col.separator()
         col.label(text="Playback:")
         col.prop(edit, "use_negative_frames")
+        col.separator()
+        col.separator()
+        col.separator()
+        col.label(text="Animation Editors:")
+        col.prop(edit, "fcurve_unselected_alpha", text="F-Curve Visibility")
 
         row.separator()
         row.separator()

Modified: trunk/blender/source/blender/editors/interface/resources.c
===================================================================
--- trunk/blender/source/blender/editors/interface/resources.c	2012-03-22 09:29:18 UTC (rev 45081)
+++ trunk/blender/source/blender/editors/interface/resources.c	2012-03-22 12:19:31 UTC (rev 45082)
@@ -1203,7 +1203,11 @@
 	}
 	if(U.pad_rot_angle==0)
 		U.pad_rot_angle= 15;
-
+	/* graph editor - unselected F-Curve visibility */
+	if (U.fcu_inactive_alpha == 0) {
+		U.fcu_inactive_alpha = 0.25f;
+	}
+	
 	/* signal for derivedmesh to use colorband */
 	/* run in case this was on and is now off in the user prefs [#28096] */
 	vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight):NULL);

Modified: trunk/blender/source/blender/editors/space_graph/graph_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_graph/graph_draw.c	2012-03-22 09:29:18 UTC (rev 45081)
+++ trunk/blender/source/blender/editors/space_graph/graph_draw.c	2012-03-22 12:19:31 UTC (rev 45082)
@@ -48,6 +48,7 @@
 #include "DNA_screen_types.h"
 #include "DNA_space_types.h"
 #include "DNA_windowmanager_types.h"
+#include "DNA_userdef_types.h"
 
 #include "BKE_context.h"
 #include "BKE_curve.h"
@@ -72,7 +73,7 @@
  * drawing components for some F-Curve (fcu)
  *	- selected F-Curves should be more visible than partially visible ones
  */
-#define drawFCurveFade(fcu) ( ((fcu)->flag & FCURVE_SELECTED)? 1.0f : 0.25f )
+#define drawFCurveFade(fcu) ( ((fcu)->flag & FCURVE_SELECTED)? 1.0f : U.fcu_inactive_alpha )
 
 /* set the color for some point from some value given packed into an int 
  *	- intV: integer value containing color info packed into an int

Modified: trunk/blender/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_userdef_types.h	2012-03-22 09:29:18 UTC (rev 45081)
+++ trunk/blender/source/blender/makesdna/DNA_userdef_types.h	2012-03-22 12:19:31 UTC (rev 45082)
@@ -422,6 +422,9 @@
 
 	int compute_device_type;
 	int compute_device_id;
+	
+	float fcu_inactive_alpha;	/* opacity of inactive F-Curves in F-Curve Editor */
+	float pad;
 } UserDef;
 
 extern UserDef U; /* from blenkernel blender.c */

Modified: trunk/blender/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_userdef.c	2012-03-22 09:29:18 UTC (rev 45081)
+++ trunk/blender/source/blender/makesrna/intern/rna_userdef.c	2012-03-22 12:19:31 UTC (rev 45082)
@@ -2644,6 +2644,14 @@
 	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_NONEGFRAMES);
 	RNA_def_property_ui_text(prop, "Allow Negative Frames",
 	                         "Current frame number can be manually set to a negative value");
+							 
+	/* fcurve opacity */
+	prop = RNA_def_property(srna, "fcurve_unselected_alpha", PROP_FLOAT, PROP_FACTOR);
+	RNA_def_property_float_sdna(prop, NULL, "fcu_inactive_alpha");
+	RNA_def_property_range(prop, 0.001f, 1.0f);
+	RNA_def_property_ui_text(prop, "Unselected F-Curve Visibility", 
+	                         "Amount that unselected F-Curves stand out from the background (Graph Editor)");
+	RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
 	
 	/* grease pencil */
 	prop = RNA_def_property(srna, "grease_pencil_manhattan_distance", PROP_INT, PROP_NONE);




More information about the Bf-blender-cvs mailing list