diff options
author | Ton Roosendaal <ton@blender.org> | 2005-05-12 00:01:42 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-05-12 00:01:42 +0400 |
commit | 0574768f8897f20e8eca213742e0987d122787c7 (patch) | |
tree | d0ed5584b2b2f09520d8692363344dbff9ff275b /source/blender/src/edittime.c | |
parent | 57f9553b3a67fdf1e152e4cda6a5ed566bc208b2 (diff) |
Animated UI for TimeLine "Play"
Using the Play button in timeline, now uses an event-driven system to
update the animation system and signal windows to redraw. Meaning the
full UI remains responsive!
Check the new Pulldown "Playback" to set which windows you like to see
updated. Same settings is used for LMB 'dragging' frames in Timeline.
Implementation notes;
- the Icon for 'Pause' (or stop) has to be made yet, I commit this from
my laptop... all was coded during a 2 x 5 hour train ride to germany
- the anim playback system (ALT+A too) now uses correct "frames per
second" as maximum speed. Buttons can be found in 3 places in the UI,
also added it as pulldown item
- The system works with 'screen handlers', which has been coded with
using Python (networked) events or verse in mind too. A doc on that
will follow.
- the buttons code has been made 'resistant' to animated UIs too,
preventing flashing of hilites.
- All subloops (like transform) stop playback, with exception of MMB
view manipulations.
As extra; found tweak to make Textured AA fonts draw without distortion.
Looks perfect here on laptop now (like Pixmap fonts) and is 20x faster.
Diffstat (limited to 'source/blender/src/edittime.c')
-rw-r--r-- | source/blender/src/edittime.c | 54 |
1 files changed, 50 insertions, 4 deletions
diff --git a/source/blender/src/edittime.c b/source/blender/src/edittime.c index 4becd3de710..359a4bbe895 100644 --- a/source/blender/src/edittime.c +++ b/source/blender/src/edittime.c @@ -418,6 +418,53 @@ void timeline_grab(int mode, int smode) // mode and smode unused here, for callb allqueue(REDRAWTIME, 0); } +/* copy of this is actually in editscreen.c, but event based */ +static void timeline_force_draw(short val) +{ + ScrArea *sa, *tempsa, *samin= NULL; + int dodraw; + + if(val & TIME_LEFTMOST_3D_WIN) { + ScrArea *sa= G.curscreen->areabase.first; + int min= 10000; + for(; sa; sa= sa->next) { + if(sa->spacetype==SPACE_VIEW3D) { + if(sa->winrct.xmin - sa->winrct.ymin < min) { + samin= sa; + min= sa->winrct.xmin - sa->winrct.ymin; + } + } + } + } + + tempsa= curarea; + sa= G.curscreen->areabase.first; + while(sa) { + dodraw= 0; + if(sa->spacetype==SPACE_VIEW3D) { + if(sa==samin || (val & TIME_ALL_3D_WIN)) dodraw= 1; + } + else if(ELEM6(sa->spacetype, SPACE_NLA, SPACE_IPO, SPACE_SEQ, SPACE_BUTS, SPACE_ACTION, SPACE_SOUND)) { + if(val & TIME_ALL_ANIM_WIN) dodraw= 1; + } + else if(sa->spacetype==SPACE_BUTS) { + if(val & TIME_ALL_BUTS_WIN) dodraw= 1; + } + else if(sa->spacetype==SPACE_TIME) dodraw= 2; + + if(dodraw) { + areawinset(sa->win); + scrarea_do_windraw(sa); + if(dodraw==2) scrarea_do_headdraw(sa); + } + sa= sa->next; + } + areawinset(tempsa->win); + + screen_swapbuffers(); + +} + /* ***************************** */ /* Right. Now for some implementation: */ @@ -462,16 +509,15 @@ void winqreadtimespace(ScrArea *sa, void *spacedata, BWinEvent *evt) { first= 0; CFRA= cfra; - update_for_newframe(); - force_draw_plus(SPACE_VIEW3D, 1); + update_for_newframe_nodraw(); + timeline_force_draw(stime->redraws); } else PIL_sleep_ms(30); } while(get_mbut() & mousebut); stime->flag &= ~TIME_CFRA_NUM; - - doredraw= 1; + allqueue(REDRAWALL, 0); break; case RIGHTMOUSE: /* select/deselect marker */ |