diff options
Diffstat (limited to 'source/blender/editors/space_time/space_time.c')
-rw-r--r-- | source/blender/editors/space_time/space_time.c | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c index 9c01780d65b..b3baccde5c9 100644 --- a/source/blender/editors/space_time/space_time.c +++ b/source/blender/editors/space_time/space_time.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or @@ -71,16 +69,20 @@ static void time_draw_sfra_efra(Scene *scene, View2D *v2d) { /* draw darkened area outside of active timeline - * frame range used is preview range or scene range */ - UI_ThemeColorShade(TH_BACK, -25); - - if (PSFRA < PEFRA) { - glRectf(v2d->cur.xmin, v2d->cur.ymin, (float)PSFRA, v2d->cur.ymax); - glRectf((float)PEFRA, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax); - } - else { - glRectf(v2d->cur.xmin, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax); - } + * frame range used is preview range or scene range + */ + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glColor4f(0.0f, 0.0f, 0.0f, 0.4f); + + if (PSFRA < PEFRA) { + glRectf(v2d->cur.xmin, v2d->cur.ymin, (float)PSFRA, v2d->cur.ymax); + glRectf((float)PEFRA, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax); + } + else { + glRectf(v2d->cur.xmin, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax); + } + glDisable(GL_BLEND); UI_ThemeColorShade(TH_BACK, -60); /* thin lines where the actual frames are */ @@ -283,7 +285,6 @@ static void time_draw_idblock_keyframes(View2D *v2d, ID *id, short onlysel) BLI_dlrbTree_init(&keys); /* init dopesheet settings */ - // FIXME: the ob_to_keylist function currently doesn't take this into account... if (onlysel) ads.filterflag |= ADS_FILTER_ONLYSEL; @@ -310,8 +311,8 @@ static void time_draw_idblock_keyframes(View2D *v2d, ID *id, short onlysel) (ak) && (ak->cfra <= v2d->cur.xmax); ak=ak->next ) { - glVertex2f(ak->cfra, v2d->cur.ymin); - glVertex2f(ak->cfra, v2d->cur.ymax); + glVertex2f(ak->cfra, v2d->tot.ymin); + glVertex2f(ak->cfra, v2d->tot.ymax); } glEnd(); // GL_LINES @@ -464,9 +465,6 @@ static void time_main_area_draw(const bContext *C, ARegion *ar) glClear(GL_COLOR_BUFFER_BIT); UI_view2d_view_ortho(v2d); - - /* start and end frame */ - time_draw_sfra_efra(scene, v2d); /* grid */ unit= (stime->flag & TIME_DRAWFRAMES)? V2D_UNIT_FRAMES: V2D_UNIT_SECONDS; @@ -474,14 +472,19 @@ static void time_main_area_draw(const bContext *C, ARegion *ar) UI_view2d_grid_draw(v2d, grid, (V2D_VERTICAL_LINES|V2D_VERTICAL_AXIS)); UI_view2d_grid_free(grid); + /* start and end frame */ + time_draw_sfra_efra(scene, v2d); + /* current frame */ + flag = DRAWCFRA_WIDE; /* this is only really needed on frames where there's a keyframe, but this will do... */ if ((stime->flag & TIME_DRAWFRAMES)==0) flag |= DRAWCFRA_UNIT_SECONDS; if (stime->flag & TIME_CFRA_NUM) flag |= DRAWCFRA_SHOW_NUMBOX; ANIM_draw_cfra(C, v2d, flag); + UI_view2d_view_ortho(v2d); + /* keyframes */ - if(!G.rendering) /* ANIM_nla_mapping_apply_fcurve() modifies curve data while rendering, possible race condition */ - time_draw_keyframes(C, stime, ar); + time_draw_keyframes(C, stime, ar); /* markers */ UI_view2d_view_orthoSpecial(ar, v2d, 1); |