diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-05-18 06:23:20 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-05-18 06:23:20 +0400 |
commit | e67e7049f9413cc070a2b2f8818ead00fb789a1c (patch) | |
tree | 9ae630897f393b4d13a04a7cb15c86c36e04a96c /source | |
parent | 7eeb8ac01cea69fc8dbf3e4a58179b1026fc6198 (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/animation/anim_ipo_utils.c | 9 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_draw.c | 23 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_select.c | 4 |
3 files changed, 26 insertions, 10 deletions
diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index 14780ebb794..c2a1199f6c6 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -242,14 +242,17 @@ void ipo_rainbow (int cur, int tot, float *out) * with some other stuff */ fac = ((float)cur / (float)tot) * 0.7f; - val = 1.0f - fac; /* the base color can get offset a bit so that the colors aren't so identical */ hue += fac * HSV_BANDWIDTH; if (hue > 1.0f) hue= fmod(hue, 1.0f); - /* saturation fluctuates between 0.5 and 1.0 */ - sat = ((cur / grouping) % 2) ? 0.61f : 0.96f; + /* saturation adjustments for more visible range */ + if ((hue > 0.5f) && (hue < 0.8f)) sat= 0.5f; + else sat= 0.6f; + + /* value is fixed at 1.0f, otherwise we cannot clearly see the curves... */ + val= 1.0f; /* finally, conver this to RGB colors */ hsv_to_rgb(hue, sat, val, out, out+1, out+2); 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 */ diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 27009ab56a4..bb923ca6f95 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -141,7 +141,9 @@ static void deselect_graph_keys (bAnimContext *ac, short test, short sel) /* Keyframes First */ ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, sel_cb, NULL); - /* deactivate the F-Curve */ + /* deactivate the F-Curve, and deselect if deselecting keyframes */ + if (sel == SELECT_SUBTRACT) + fcu->flag &= ~FCURVE_SELECTED; fcu->flag &= ~FCURVE_ACTIVE; } |