* Added hotkeys for rendering animation (Ctrl F12) and playing back

animation (Ctrl F11) similar to rendering a still with F12 and showing it in
the buffer with F11.
This commit is contained in:
Matt Ebb 2005-09-13 09:52:00 +00:00
parent c27799910f
commit 0af69ddd09
3 changed files with 34 additions and 35 deletions

@ -96,6 +96,8 @@
- anim settings, audio
*/
/* prototypes */
void playback_anim(void);
/* ************************ SOUND *************************** */
static void load_new_sample(char *str) /* called from fileselect */
@ -477,26 +479,10 @@ static void run_playanim(char *file) {
system(str);
}
void do_render_panels(unsigned short event)
void playback_anim(void)
{
ScrArea *sa;
ID *id;
char file[FILE_MAXDIR+FILE_MAXFILE];
switch(event) {
case B_DORENDER:
BIF_do_render(0);
break;
case B_RTCHANGED:
allqueue(REDRAWALL, 0);
break;
case B_SWITCHRENDER:
/* new panels added, so... */
G.buts->re_align= 1;
allqueue(REDRAWBUTSSCENE, 0);
break;
case B_PLAYANIM:
#ifdef WITH_QUICKTIME
if(G.scene->r.imtype == R_QUICKTIME)
makeqtstring(file);
@ -513,6 +499,28 @@ void do_render_panels(unsigned short event)
}
else error("Can't find image: %s", file);
}
}
void do_render_panels(unsigned short event)
{
ScrArea *sa;
ID *id;
switch(event) {
case B_DORENDER:
BIF_do_render(0);
break;
case B_RTCHANGED:
allqueue(REDRAWALL, 0);
break;
case B_SWITCHRENDER:
/* new panels added, so... */
G.buts->re_align= 1;
allqueue(REDRAWBUTSSCENE, 0);
break;
case B_PLAYANIM:
playback_anim();
break;
case B_DOANIM:

@ -1464,8 +1464,7 @@ static void do_info_rendermenu(void *arg, int event)
{
char file[FILE_MAXDIR+FILE_MAXFILE];
extern void makeavistring(char *string);
extern void makeqtstring (char *string);
extern void playback_anim();
switch(event) {
@ -1483,22 +1482,7 @@ static void do_info_rendermenu(void *arg, int event)
BIF_toggle_render_display();
break;
case 5:
#ifdef WITH_QUICKTIME
if(G.scene->r.imtype == R_QUICKTIME)
makeqtstring(file);
else
#endif
makeavistring(file);
if(BLI_exist(file)) {
run_playanim(file);
}
else {
makepicstring(file, G.scene->r.sfra);
if(BLI_exist(file)) {
run_playanim(file);
}
else error("Can't find image: %s", file);
}
playback_anim();
break;
case 6:
/* dodgy hack turning on SHIFT key to do a proper render border select

@ -520,6 +520,7 @@ int blenderqread(unsigned short event, short val)
/* here do the general keys handling (not screen/window/space) */
/* return 0: do not pass on to the other queues */
extern int textediting;
extern void playback_anim();
ScrArea *sa;
Object *ob;
int textspace=0;
@ -655,6 +656,9 @@ int blenderqread(unsigned short event, short val)
newspace(curarea, SPACE_TEXT);
return 0;
}
else if (G.qual==LR_CTRLKEY) {
playback_anim();
}
else if(G.qual==0) {
BIF_toggle_render_display();
return 0;
@ -669,6 +673,9 @@ int blenderqread(unsigned short event, short val)
newspace(curarea, SPACE_NLA);
return 0;
}
else if (G.qual==LR_CTRLKEY) {
BIF_do_render(1);
}
else {
/* ctrl/alt + f12 should render too, for some macs have f12 assigned to cd eject */
BIF_do_render(0);