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:
@@ -885,22 +885,38 @@ static void ui_draw_links(uiBlock *block)
|
||||
void uiDrawBlock(uiBlock *block)
|
||||
{
|
||||
uiBut *but;
|
||||
|
||||
short testmouse=0, mouse[2];
|
||||
|
||||
/* handle pending stuff */
|
||||
if(block->autofill) ui_autofill(block);
|
||||
if(block->minx==0.0 && block->maxx==0.0) uiBoundsBlock(block, 0);
|
||||
if(block->flag & UI_BUT_ALIGN) uiBlockEndAlign(block);
|
||||
|
||||
/* we set active flag on a redraw again */
|
||||
if((block->flag & UI_BLOCK_LOOP)==0) {
|
||||
testmouse= 1;
|
||||
Mat4CpyMat4(UIwinmat, block->winmat);
|
||||
uiGetMouse(block->win, mouse);
|
||||
}
|
||||
|
||||
uiPanelPush(block); // panel matrix
|
||||
|
||||
if(block->flag & UI_BLOCK_LOOP) {
|
||||
uiDrawMenuBox(block->minx, block->miny, block->maxx, block->maxy, block->flag);
|
||||
}
|
||||
else if(block->panel) ui_draw_panel(block);
|
||||
|
||||
else {
|
||||
if(block->panel) ui_draw_panel(block);
|
||||
}
|
||||
|
||||
if(block->drawextra) block->drawextra();
|
||||
|
||||
for (but= block->buttons.first; but; but= but->next) {
|
||||
|
||||
if(testmouse && uibut_contains_pt(but, mouse))
|
||||
but->flag |= UI_ACTIVE;
|
||||
else
|
||||
but->flag &= ~UI_ACTIVE;
|
||||
|
||||
ui_draw_but(but);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user