From e67e7049f9413cc070a2b2f8818ead00fb789a1c Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 18 May 2009 02:23:20 +0000 Subject: Graph Editor: Attempts at Improving Curve Drawing * Trying a slightly different approach with curve drawing. Now curves aren't drawn darker down the list, as that approach proved to have massive contrast issues all around. However, it's not completely back to the old rainbow style, as the colours are still grouped in 3's and 4's, only that they now use hue offsets... * Unselected curves are now drawn less opaque. However, selected curves still leave some brightness to be desired... * Bugfix - Deselecting keyframes in graph view now deselects the curves too. --- source/blender/editors/space_graph/graph_draw.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/space_graph/graph_draw.c') diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index e3a6d502332..f6d9406e7da 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -782,11 +782,20 @@ static short fcurve_needs_draw_fmodifier_controls (FCurve *fcu, FModifier *fcm) if (fcu->modifiers.first == NULL) return 0; - /* if there's an active modifier - don't draw if it is cycles modifier, since - * that basically still shows the original points + /* if there's an active modifier - don't draw if it doesn't drastically + * alter the curve... */ - if ((fcm) && (fcm->type == FMODIFIER_TYPE_CYCLES)) - return 0; + if (fcm) { + switch (fcm->type) { + /* clearly harmless */ + case FMODIFIER_TYPE_CYCLES: + return 0; + + /* borderline... */ + case FMODIFIER_TYPE_NOISE: + return 0; + } + } /* if only one modifier - don't draw if it is muted or disabled */ if (fcu->modifiers.first == fcu->modifiers.last) { @@ -853,8 +862,10 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri UI_ThemeColorShade(TH_HEADER, 50); } else { - /* set whatever color the curve has set */ - glColor3fv(fcu->color); + /* set whatever color the curve has set + * - unselected curves draw less opaque to help distinguish the selected ones + */ + glColor4f(fcu->color[0], fcu->color[1], fcu->color[2], ((sel) ? 1.0f : 0.5f)); } /* anti-aliased lines for less jagged appearance */ -- cgit v1.2.3