[Bf-committers] Fully animated & active UI

Ton Roosendaal ton at blender.org
Mon May 9 17:12:17 CEST 2005


Hi,

While discussing TimeLine, someone mentioned to find it 'bad' that the  
button "Play" doesn't become a 'stop' or 'pause' button. This is of  
course logical, since currently the ALT+A option is its own loop and  
leaves the UI not responsive.

I know Blender can do this however... simply using the internal event &  
timing  system. I've hacked together a first test, code you can find  
below. Insert it in src/editscreen.c in the end of the function:  
screen_dispatch_events(void)

Now name the screen with an 'A' as first letter, and have fun! :)

A real 'animated UI' feature will need more work though, to nicer  
integrate with all events. You can also notice where Blender goes into  
subloops (like transform, or buttons). Ideas for usablity have to be  
expored, like;

- Make some kind of preset menu in TimeLine menu which tells which  
windows have to become 'animated' ?
- Or only animate the active window? (Where mouse is in)
- And so on...

-Ton-


	/* screen handler? */
	if(G.curscreen->id.name[2]=='A') {
		extern double speed_to_swaptime(int speed);
		static double ltime=0.0;
		double swaptime, time;
		
		time = PIL_check_seconds_timer();
		
		swaptime= speed_to_swaptime(G.animspeed);
		
		if(swaptime < time-ltime || ltime==0.0) {
			ltime= time;
		
			CFRA++;
			if(CFRA > EFRA) CFRA= SFRA;
			update_for_newframe_muted();
			allqueue(REDRAWVIEW3D, 0);
		}
		addafterqueue(curarea->win, -1, 1);
	}


------------------------------------------------------------------------ 
--
Ton Roosendaal  Blender Foundation ton at blender.org  
http://www.blender.org



More information about the Bf-committers mailing list