diff options
author | Joshua Leung <aligorith@gmail.com> | 2018-04-19 19:03:15 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2018-04-20 19:54:41 +0300 |
commit | c9fc11a314662dd0ed1b9fb9de4d057b2cf2f1b3 (patch) | |
tree | b700c67682ce8241da778fe504c984269e13c1e3 /source/blender/editors/space_action | |
parent | 0f77060ebcd5fed47e7d037fa214a02e9529790f (diff) |
AnimEditors: Draw start/end frame ranges on all timelines by default
This uses the global scene range, with styling matching the sequencer's start/end
frame drawing.
(The graph editor's "drivers" mode is exempt, as that doesn't really display time
in a linear way, so the start/end frames don't apply)
Diffstat (limited to 'source/blender/editors/space_action')
-rw-r--r-- | source/blender/editors/space_action/action_intern.h | 1 | ||||
-rw-r--r-- | source/blender/editors/space_action/space_action.c | 11 |
2 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/space_action/action_intern.h b/source/blender/editors/space_action/action_intern.h index 29c53815b3a..6ec6f0561c2 100644 --- a/source/blender/editors/space_action/action_intern.h +++ b/source/blender/editors/space_action/action_intern.h @@ -39,6 +39,7 @@ struct SpaceAction; struct ScrArea; struct ARegion; struct ARegionType; +struct View2D; struct wmOperatorType; /* internal exports only */ diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index b171b2e9b8a..6b95f9c41c4 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -34,6 +34,7 @@ #include "DNA_action_types.h" #include "DNA_group_types.h" +#include "DNA_object_types.h" #include "DNA_scene_types.h" #include "MEM_guardedalloc.h" @@ -212,6 +213,8 @@ static void action_main_region_draw(const bContext *C, ARegion *ar) { /* draw entirely, view changes should be handled here */ SpaceAction *saction = CTX_wm_space_action(C); + Scene *scene = CTX_data_scene(C); + Object *obact = CTX_data_active_object(C); bAnimContext ac; View2D *v2d = &ar->v2d; View2DGrid *grid; @@ -231,7 +234,10 @@ static void action_main_region_draw(const bContext *C, ARegion *ar) UI_view2d_grid_free(grid); ED_region_draw_cb_draw(C, ar, REGION_DRAW_PRE_VIEW); - + + /* start and end frame */ + ANIM_draw_framerange(scene, v2d); + /* data */ if (ANIM_animdata_get_context(C, &ac)) { draw_channel_strips(&ac, saction, ar); @@ -250,11 +256,10 @@ static void action_main_region_draw(const bContext *C, ARegion *ar) /* caches */ if (saction->mode == SACTCONT_TIMELINE) { - timeline_draw_cache(saction, ac.obact, ac.scene); + timeline_draw_cache(saction, obact, scene); } /* preview range */ - // XXX: we should always draw the range UI_view2d_view_ortho(v2d); ANIM_draw_previewrange(C, v2d, 0); |