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.
This commit is contained in:
2005-05-11 20:01:42 +00:00
parent 57f9553b3a
commit 0574768f88
18 changed files with 373 additions and 132 deletions

View File

@@ -2229,75 +2229,6 @@ int update_time(void)
return (tottime < 0.0);
}
double speed_to_swaptime(int speed)
{
switch(speed) {
case 1:
return 1.0/60.0;
case 2:
return 1.0/50.0;
case 3:
return 1.0/30.0;
case 4:
return 1.0/25.0;
case 5:
return 1.0/20.0;
case 6:
return 1.0/15.0;
case 7:
return 1.0/12.5;
case 8:
return 1.0/10.0;
case 9:
return 1.0/6.0;
}
return 1.0/4.0;
}
double key_to_swaptime(int key)
{
switch(key) {
case PAD1:
G.animspeed= 1;
tottime= 0;
return speed_to_swaptime(1);
case PAD2:
G.animspeed= 2;
tottime= 0;
return speed_to_swaptime(2);
case PAD3:
G.animspeed= 3;
tottime= 0;
return speed_to_swaptime(3);
case PAD4:
G.animspeed= 4;
tottime= 0;
return speed_to_swaptime(4);
case PAD5:
G.animspeed= 5;
tottime= 0;
return speed_to_swaptime(5);
case PAD6:
G.animspeed= 6;
tottime= 0;
return speed_to_swaptime(6);
case PAD7:
G.animspeed= 7;
tottime= 0;
return speed_to_swaptime(7);
case PAD8:
G.animspeed= 8;
tottime= 0;
return speed_to_swaptime(8);
case PAD9:
G.animspeed= 9;
tottime= 0;
return speed_to_swaptime(9);
}
return speed_to_swaptime(G.animspeed);
}
void inner_play_anim_loop(int init, int mode)
{
ScrArea *sa;
@@ -2308,7 +2239,7 @@ void inner_play_anim_loop(int init, int mode)
/* init */
if(init) {
oldsa= curarea;
swaptime= speed_to_swaptime(G.animspeed);
swaptime= 1.0/(float)G.scene->r.frs_sec;
tottime= 0.0;
curmode= mode;
@@ -2452,8 +2383,6 @@ int play_anim(int mode)
sa= sa->next;
}
/* speed button */
// allqueue(REDRAWBUTSOBJECT, 0);
/* groups could have changed ipo */
allspace(REMAKEIPO, 0);
allqueue(REDRAWIPO, 0);