From 6343d4e233e96acee76d68adc060498313bb8d6c Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 20 Dec 2008 08:24:24 +0000 Subject: 2.5 - Start of porting of Animation Editors * Added new 'Animation' submodule under Editors. This will be used to house all code + features that are used by many different Animation Editors (Action/Dopesheet and IPO) as well as other parts of Blender. * Added back some of the core code need by the Action/Dopesheet editor, which will also be used by IPO Editor. * Brought back file for keyframing management code (i.e. keyframing.c), but there's still quite a lot of missing stuff that I'll need to restore, so in the meantime, it's #if 0'd out. * Moved markers code to this new module (I'm not sure whether SVN will recognise this change, as TortoiseSVN doesn't seem to have any obvious copy/move commands) --- source/blender/editors/space_time/space_time.c | 3 ++- source/blender/editors/space_time/time_ops.c | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/space_time') diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c index e89a64faf94..5cadd521b66 100644 --- a/source/blender/editors/space_time/space_time.c +++ b/source/blender/editors/space_time/space_time.c @@ -85,7 +85,8 @@ static void time_draw_cfra_time(const bContext *C, SpaceTime *stime, ARegion *ar static void time_draw_sfra_efra(const bContext *C, SpaceTime *stime, ARegion *ar) { - View2D *v2d= UI_view2d_fromcontext(C); + View2D *v2d= UI_view2d_fromcontext(C); + //Scene *scene= CTX_data_scene(C); /* draw darkened area outside of active timeline * frame range used is preview range or scene range */ diff --git a/source/blender/editors/space_time/time_ops.c b/source/blender/editors/space_time/time_ops.c index 30b0e808e05..e8704457c00 100644 --- a/source/blender/editors/space_time/time_ops.c +++ b/source/blender/editors/space_time/time_ops.c @@ -181,16 +181,18 @@ void ED_TIME_OT_change_frame(wmOperatorType *ot) static int toggle_time_exec(bContext *C, wmOperator *op) { - SpaceTime *stime; + SpaceTime *stime= (SpaceTime *)CTX_wm_space_data(C); + ScrArea *curarea= CTX_wm_area(C); - if (ELEM(NULL, CTX_wm_area(C), CTX_wm_space_data(C))) + if (ELEM(NULL, curarea, stime)) return OPERATOR_CANCELLED; /* simply toggle draw frames flag for now */ - // XXX in past, this displayed menu to choose... (for later!) - stime= (SpaceTime*)CTX_wm_space_data(C); + // in past, this asked user to choose in a menu beforehand, but that is clumsy stime->flag ^= TIME_DRAWFRAMES; + ED_area_tag_redraw(curarea); + return OPERATOR_FINISHED; } -- cgit v1.2.3