Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-12-11 14:18:55 +0300
committerJoshua Leung <aligorith@gmail.com>2009-12-11 14:18:55 +0300
commitfba99b627b001177590e73471f0b0f29a832bc14 (patch)
tree48b8a7b369ad94c35c2d66f43873c9f369a3d21c /source/blender/editors/space_time
parent7e7e1018acfb23f0e10d4ae051d002a6516b8d83 (diff)
Timeline Drawing Tweaks:
* Made the TimeLine current frame indicator get drawn using the standard frame-indicator code. Also, it is now possible to show the frame indicator box beside the line as in the other animation editors, although this is disabled in the timeline due to the closeness of the frame number field. * Removed some old (unnecessary) code -> "Continue Physics" option in TimeLine, which is now obsolete with the current physics options. Feel free to restore if this is not the case. -> Already commented out hacks to create "speed ipo" for curves. There are easy alternatives that are better integrated. -> Unused init/exit callbacks for scrubbing time, since those were only used to set an obsolete flag for timeline drawing that is now used for the indicator. * Switched long-keyframe optimisation code to use constants instead of some magic numbers + fancy trickery...
Diffstat (limited to 'source/blender/editors/space_time')
-rw-r--r--source/blender/editors/space_time/space_time.c28
1 files changed, 5 insertions, 23 deletions
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c
index 59314fba48e..eea5891a720 100644
--- a/source/blender/editors/space_time/space_time.c
+++ b/source/blender/editors/space_time/space_time.c
@@ -45,6 +45,7 @@
#include "BKE_screen.h"
#include "BKE_utildefines.h"
+#include "ED_anim_api.h"
#include "ED_keyframes_draw.h"
#include "ED_space_api.h"
#include "ED_screen.h"
@@ -66,27 +67,6 @@
/* ************************ main time area region *********************** */
-/* draws a current frame indicator for the TimeLine */
-static void time_draw_cfra_time(const bContext *C, SpaceTime *stime, ARegion *ar)
-{
- Scene *scene= CTX_data_scene(C);
- float vec[2];
-
- vec[0]= scene->r.cfra*scene->r.framelen;
-
- UI_ThemeColor(TH_CFRAME); // no theme, should be global color once...
- glLineWidth(3.0);
-
- glBegin(GL_LINES);
- vec[1]= ar->v2d.cur.ymin;
- glVertex2fv(vec);
- vec[1]= ar->v2d.cur.ymax;
- glVertex2fv(vec);
- glEnd();
-
- glLineWidth(1.0);
-}
-
static void time_draw_sfra_efra(const bContext *C, SpaceTime *stime, ARegion *ar)
{
View2D *v2d= UI_view2d_fromcontext(C);
@@ -218,8 +198,8 @@ static void time_main_area_draw(const bContext *C, ARegion *ar)
View2D *v2d= &ar->v2d;
View2DGrid *grid;
View2DScrollers *scrollers;
+ int unit, flag=0;
float col[3];
- int unit;
/* clear and setup matrix */
UI_GetThemeColor3fv(TH_BACK, col);
@@ -241,7 +221,9 @@ static void time_main_area_draw(const bContext *C, ARegion *ar)
time_draw_keyframes(C, stime, ar);
/* current frame */
- time_draw_cfra_time(C, stime, ar);
+ 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);
/* markers */
UI_view2d_view_orthoSpecial(C, v2d, 1);