diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-03-08 09:42:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-03-08 09:47:02 +0300 |
commit | 222a941a2bbd71dcaa1012cdea959954ca065c6a (patch) | |
tree | 798c5a245de42556afabc91d8a7c45eb61337b04 /source/blender/editors/space_nla/nla_draw.c | |
parent | 872df463f62d55911a2a732775a8de434c281b2d (diff) | |
parent | 28f86bf117e9d9d10089ef758a5ec4ade65084c6 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/space_nla/nla_draw.c')
-rw-r--r-- | source/blender/editors/space_nla/nla_draw.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index a18a692c0a3..a7773aaaed5 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -316,18 +316,20 @@ static void nla_draw_strip_curves(NlaStrip *strip, float yminc, float ymaxc, uns float cfra; /* plot the curve (over the strip's main region) */ - immBegin(GWN_PRIM_LINE_STRIP, abs((int)(strip->end - strip->start) + 1)); + if (fcu) { + immBegin(GWN_PRIM_LINE_STRIP, abs((int)(strip->end - strip->start) + 1)); - /* sample at 1 frame intervals, and draw - * - min y-val is yminc, max is y-maxc, so clamp in those regions - */ - for (cfra = strip->start; cfra <= strip->end; cfra += 1.0f) { - float y = evaluate_fcurve(fcu, cfra); /* assume this to be in 0-1 range */ - CLAMP(y, 0.0f, 1.0f); - immVertex2f(pos, cfra, ((y * yheight) + yminc)); - } + /* sample at 1 frame intervals, and draw + * - min y-val is yminc, max is y-maxc, so clamp in those regions + */ + for (cfra = strip->start; cfra <= strip->end; cfra += 1.0f) { + float y = evaluate_fcurve(fcu, cfra); /* assume this to be in 0-1 range */ + CLAMP(y, 0.0f, 1.0f); + immVertex2f(pos, cfra, ((y * yheight) + yminc)); + } - immEnd(); + immEnd(); + } } else { /* use blend in/out values only if both aren't zero */ |