diff options
author | Joshua Leung <aligorith@gmail.com> | 2012-03-22 16:19:31 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2012-03-22 16:19:31 +0400 |
commit | 5cf739c2dad6002f4716f0ccf514bd2544e0698d (patch) | |
tree | baa3810878d738ce934760994c1bf22ccddcd3ac /source/blender | |
parent | db37011930f2d59ba85d91bec43ff420e451df9b (diff) |
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.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/resources.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_draw.c | 3 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 3 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 8 |
4 files changed, 18 insertions, 2 deletions
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 1875a098793..7f45a48ddba 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -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); diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 8af16bd1aec..fd0fa538d81 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -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 diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 3dbe6f49ca9..9c8c3a7731c 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -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 */ diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index b9bc7311303..dd26df0a10f 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -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); |