Quick Mango request: Adjustable contrast/intensity for unselected F-Curves in
authorJoshua Leung <aligorith@gmail.com>
Thu, 22 Mar 2012 12:19:31 +0000 (12:19 +0000)
committerJoshua Leung <aligorith@gmail.com>
Thu, 22 Mar 2012 12:19:31 +0000 (12:19 +0000)
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.

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

index cb4fa8079ceadc3c102edafa82efff68a6513ef1..c87bba7751d77cd4ca070dd14e12ae6c8e808951 100644 (file)
@@ -304,6 +304,11 @@ class USERPREF_PT_edit(Panel):
         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()
index 1875a098793629c7c90e2536d94dfa06440dd7b6..7f45a48ddba5e5a1aaae72711e7f906516ee47f2 100644 (file)
@@ -1203,7 +1203,11 @@ void init_userdef_do_versions(void)
        }
        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);
index 8af16bd1aec5abcb2772261fdfc6c5d53833ced1..fd0fa538d81be2fb691914d3c3f9706664f9a7b8 100644 (file)
@@ -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
index 3dbe6f49ca9e81230d3687321b696a6ecab71285..9c8c3a7731cdd159f0b8a72afe96a8ae4a15f824 100644 (file)
@@ -422,6 +422,9 @@ typedef struct UserDef {
 
        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 */
index b9bc73113033979929b67923fa9da66364f3e7f7..dd26df0a10f171024518c2a9118243be453abe31 100644 (file)
@@ -2644,6 +2644,14 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
        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);