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.
This commit is contained in:
Joshua Leung 2012-03-22 12:19:31 +00:00
parent db37011930
commit 5cf739c2da
5 changed files with 23 additions and 2 deletions

@ -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()

@ -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);

@ -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

@ -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 */

@ -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);