== Sequencer ==

Big proxy fix (addressing hopefully most complaints on mailing list and 
in tracker)
* proxy render settings are now independent of render size settings.
  That means: which proxy size is used, is controlled by two parameters
  now: the proxy size of the files, can be controlled with additional
  buttons within the proxy panels. What is shown in a specific preview
  window depends on the header settings of the preview panel.
  So: proxies are _only_ used in those windows, that are switched to a
  specific proxy resolution.
* output rendering is always done _without_ proxies.
* proxy generation now shows a waitcursor with numbers.
  (closing Bug: [#18909] Building Proxies doesn't give any feedback
  which was rather a feature request, since the problem mentioned there
  was always the case :) )
This commit is contained in:
Peter Schlaile 2009-06-14 18:54:35 +00:00
parent 36e96e5b6e
commit ca12954e9f
7 changed files with 167 additions and 89 deletions

View File

@ -41,7 +41,7 @@ struct ListBase;
struct MemFile;
#define BLENDER_VERSION 249
#define BLENDER_SUBVERSION 1
#define BLENDER_SUBVERSION 2
#define BLENDER_MINVERSION 245
#define BLENDER_MINSUBVERSION 15

View File

@ -8156,6 +8156,34 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
if (main->versionfile < 249 && main->subversionfile < 2) {
Scene *sce= main->scene.first;
Sequence *seq;
Editing *ed;
while(sce) {
ed= sce->ed;
if(ed) {
WHILE_SEQ(&ed->seqbase) {
if (seq->strip && seq->strip->proxy){
if (G.scene->r.size != 100.0) {
seq->strip->proxy->size
= sce->r.size;
} else {
seq->strip->proxy->size
= 25.0;
}
seq->strip->proxy->quality =90;
}
}
END_SEQ
}
sce= sce->id.next;
}
}
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */

View File

@ -80,6 +80,9 @@ typedef struct StripProxy {
char dir[160];
char file[80];
struct anim *anim;
short size;
short quality;
int pad;
} StripProxy;
typedef struct Strip {

View File

@ -1164,6 +1164,8 @@ static void seq_panel_proxy()
{
Sequence *last_seq = get_last_seq();
uiBlock *block;
int yofs;
block = uiNewBlock(&curarea->uiblocks, "seq_panel_proxy",
UI_EMBOSS, UI_HELV, curarea->win);
@ -1172,83 +1174,118 @@ static void seq_panel_proxy()
uiBlockBeginAlign(block);
yofs = 140;
uiDefButBitI(block, TOG, SEQ_USE_PROXY,
B_SEQ_BUT_RELOAD, "Use Proxy",
10,140,80,19, &last_seq->flag,
10,yofs,80,19, &last_seq->flag,
0.0, 21.0, 100, 0,
"Use a preview proxy for this strip");
if (last_seq->flag & SEQ_USE_PROXY) {
if (!last_seq->strip->proxy) {
last_seq->strip->proxy =
MEM_callocN(sizeof(struct StripProxy),
"StripProxy");
}
uiDefButBitI(block, TOG, SEQ_USE_PROXY_CUSTOM_DIR,
B_SEQ_BUT_RELOAD, "Custom Dir",
90,140,80,19, &last_seq->flag,
0.0, 21.0, 100, 0,
"Use a custom directory to store data");
uiDefButBitI(block, TOG, SEQ_USE_PROXY_CUSTOM_FILE,
B_SEQ_BUT_RELOAD, "Custom File",
170,140,80,19, &last_seq->flag,
0.0, 21.0, 100, 0,
"Use a custom file to load data from");
if (last_seq->flag & SEQ_USE_PROXY_CUSTOM_DIR) {
uiDefIconBut(block, BUT, B_SEQ_SEL_PROXY_DIR,
ICON_FILESEL, 10, 120, 20, 20, 0, 0, 0, 0, 0,
"Select the directory/name for "
"the proxy storage");
uiDefBut(block, TEX,
B_SEQ_BUT_RELOAD, "Dir: ",
30,120,220,20, last_seq->strip->proxy->dir,
0.0, (float)sizeof(last_seq->strip->proxy->dir)-1, 100, 0, "");
}
if (last_seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) {
uiDefIconBut(block, BUT, B_SEQ_SEL_PROXY_FILE,
ICON_FILESEL, 10, 100, 20, 20, 0, 0, 0,
0, 0,
"Select the custom proxy file "
"(used for all preview resolutions!)");
uiDefBut(block, TEX,
B_SEQ_BUT_RELOAD, "File: ",
30,100,220,20, last_seq->strip->proxy->file,
0.0, (float)sizeof(last_seq->strip->proxy->file)-1, 100, 0, "");
}
if (!(last_seq->flag & SEQ_USE_PROXY)) {
uiBlockEndAlign(block);
return;
}
if (last_seq->flag & SEQ_USE_PROXY) {
if (G.scene->r.size == 100) {
uiDefBut(block, LABEL, 0,
"Full render size selected, ",
10,60,240,19, 0, 0, 0, 0, 0, "");
uiDefBut(block, LABEL, 0,
"so no proxy enabled!",
10,40,240,19, 0, 0, 0, 0, 0, "");
} else if (last_seq->type != SEQ_MOVIE
&& last_seq->type != SEQ_IMAGE
&& !(last_seq->flag & SEQ_USE_PROXY_CUSTOM_DIR)) {
uiDefBut(block, LABEL, 0,
"Cannot proxy this strip without ",
10,60,240,19, 0, 0, 0, 0, 0, "");
uiDefBut(block, LABEL, 0,
"custom directory selection!",
10,40,240,19, 0, 0, 0, 0, 0, "");
} else if (!(last_seq->flag & SEQ_USE_PROXY_CUSTOM_FILE)) {
uiDefBut(block, BUT, B_SEQ_BUT_REBUILD_PROXY,
"Rebuild proxy",
10,60,240,19, 0, 0, 0, 0, 0,
"Rebuild proxy for the "
"currently selected strip.");
if (!last_seq->strip->proxy) {
last_seq->strip->proxy =
MEM_callocN(sizeof(struct StripProxy),
"StripProxy");
}
uiDefButBitI(block, TOG, SEQ_USE_PROXY_CUSTOM_DIR,
B_SEQ_BUT_RELOAD, "Custom Dir",
90,yofs,80,19, &last_seq->flag,
0.0, 21.0, 100, 0,
"Use a custom directory to store data");
uiDefButBitI(block, TOG, SEQ_USE_PROXY_CUSTOM_FILE,
B_SEQ_BUT_RELOAD, "Custom File",
170,yofs,80,19, &last_seq->flag,
0.0, 21.0, 100, 0,
"Use a custom file to load data from");
if (last_seq->flag & SEQ_USE_PROXY_CUSTOM_DIR ||
last_seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) {
yofs -= 20;
uiDefIconBut(block, BUT, B_SEQ_SEL_PROXY_DIR,
ICON_FILESEL, 10, yofs, 20, 20, 0, 0, 0, 0, 0,
"Select the directory/name for "
"the proxy storage");
uiDefBut(block, TEX,
B_SEQ_BUT_RELOAD, "Dir: ",
30,yofs,220,20, last_seq->strip->proxy->dir,
0.0, (float)sizeof(last_seq->strip->proxy->dir)-1,
100, 0, "");
}
if (last_seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) {
yofs -= 20;
uiDefIconBut(block, BUT, B_SEQ_SEL_PROXY_FILE,
ICON_FILESEL, 10, yofs, 20, 20, 0, 0, 0,
0, 0,
"Select the custom proxy file "
"(used for all preview resolutions!)");
uiDefBut(block, TEX,
B_SEQ_BUT_RELOAD, "File: ",
30, yofs,220,20, last_seq->strip->proxy->file,
0.0, (float)sizeof(last_seq->strip->proxy->file)-1,
100, 0, "");
}
if (!(last_seq->flag & SEQ_USE_PROXY_CUSTOM_FILE)) {
if (last_seq->strip->proxy->size == 0) {
if (G.scene->r.size != 100) {
last_seq->strip->proxy->size = G.scene->r.size;
} else {
last_seq->strip->proxy->size = 25;
}
}
if (last_seq->strip->proxy->quality == 0) {
last_seq->strip->proxy->quality = 90;
}
yofs -= 25;
uiDefButS(block, NUM,B_DIFF, "Q:", 10,yofs,74,20,
&last_seq->strip->proxy->quality,
10.0, 100.0, 0, 0,
"Quality setting for JPEG images");
uiDefButS(block, ROW,B_DIFF,"75%", 90,yofs,53,20,
&last_seq->strip->proxy->size,1.0,75.0, 0, 0,
"Set proxy size to 3/4 of defined size");
uiDefButS(block, ROW,B_DIFF,"50%", 143,yofs,53,20,
&last_seq->strip->proxy->size,1.0,50.0, 0, 0,
"Set proxy size to 1/2 of defined size");
uiDefButS(block, ROW,B_DIFF,"25%", 196,yofs,53,20,
&last_seq->strip->proxy->size,1.0,25.0, 0, 0,
"Set proxy size to 1/4 of defined size");
}
if (last_seq->type != SEQ_MOVIE
&& last_seq->type != SEQ_IMAGE
&& !(last_seq->flag & SEQ_USE_PROXY_CUSTOM_DIR)) {
yofs -= 20;
uiDefBut(block, LABEL, 0,
"Cannot proxy this strip without ",
30,yofs,240,19, 0, 0, 0, 0, 0, "");
yofs -= 20;
uiDefBut(block, LABEL, 0,
"custom directory selection!",
30,yofs,240,19, 0, 0, 0, 0, 0, "");
} else if (!(last_seq->flag & SEQ_USE_PROXY_CUSTOM_FILE)) {
yofs -= 45;
uiDefBut(block, BUT, B_SEQ_BUT_REBUILD_PROXY,
"Rebuild proxy",
10,yofs,240,40, 0, 0, 0, 0, 0,
"Rebuild proxy for the "
"currently selected strip.");
}
uiBlockEndAlign(block);
}

View File

@ -849,7 +849,8 @@ static void draw_image_seq(ScrArea *sa)
static int recursive= 0;
float zoom;
float zoomx, zoomy;
int render_size = 0;
float render_size = 0.0;
float proxy_size = 100.0;
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
@ -860,6 +861,8 @@ static void draw_image_seq(ScrArea *sa)
render_size = sseq->render_size;
if (render_size == 0) {
render_size = G.scene->r.size;
} else {
proxy_size = render_size;
}
if (render_size < 0) {
return;
@ -879,16 +882,16 @@ static void draw_image_seq(ScrArea *sa)
recursive= 1;
if (special_seq_update) {
ibuf= give_ibuf_seq_direct(
rectx, recty, (G.scene->r.cfra), render_size,
rectx, recty, (G.scene->r.cfra), proxy_size,
special_seq_update);
} else if (!U.prefetchframes || (G.f & G_PLAYANIM) == 0) {
ibuf= (ImBuf *)give_ibuf_seq(
rectx, recty, (G.scene->r.cfra),
sseq->chanshown, render_size);
sseq->chanshown, proxy_size);
} else {
ibuf= (ImBuf *)give_ibuf_seq_threaded(
rectx, recty, (G.scene->r.cfra),
sseq->chanshown, render_size);
sseq->chanshown, proxy_size);
}
recursive= 0;
@ -939,7 +942,7 @@ static void draw_image_seq(ScrArea *sa)
zoom= SEQ_ZOOM_FAC(sseq->zoom);
if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
zoom /= render_size / 100.0;
zoom /= proxy_size / 100.0;
zoomx = zoom * ((float)G.scene->r.xasp / (float)G.scene->r.yasp);
zoomy = zoom;
} else {
@ -1122,8 +1125,11 @@ void drawprefetchseqspace(ScrArea *sa, void *spacedata)
SpaceSeq *sseq= sa->spacedata.first;
int rectx, recty;
int render_size = sseq->render_size;
int proxy_size = 100.0;
if (render_size == 0) {
render_size = G.scene->r.size;
} else {
proxy_size = render_size;
}
if (render_size < 0) {
return;
@ -1135,7 +1141,7 @@ void drawprefetchseqspace(ScrArea *sa, void *spacedata)
if(sseq->mainb) {
give_ibuf_prefetch_request(
rectx, recty, (G.scene->r.cfra), sseq->chanshown,
render_size);
proxy_size);
}
}

View File

@ -741,16 +741,16 @@ void seq_buttons()
xco+= 8 + XIC*3.5;
uiDefButS(block, MENU, B_REDR,
"Render size: %t"
"|R 100 %x100"
"|R 75 %x75"
"|R 50 %x50"
"|R 25 %x25"
"|R Sce %x0"
"|R Off %x-1",
"Proxy Render Size: %t"
"|Q 100 %x100"
"|Q 75 %x75"
"|Q 50 %x50"
"|Q 25 %x25"
"|Q Sce %x0"
"|Q Off %x-1",
xco,0,3.0 * XIC, YIC, &sseq->render_size,
0,0,0,0,
"Use different (proxy) render size "
"Use different proxy render size settings "
"for this preview screen, use scene render size "
"or disable this preview completely");

View File

@ -1211,7 +1211,7 @@ static void seq_proxy_build_frame(Sequence * seq, int cfra, int render_size)
depth = 32 is intentionally left in, otherwise ALPHA channels
won't work... */
quality = 90;
quality = seq->strip->proxy->quality;
ibuf->ftype= JPG | quality;
BLI_make_existing_file(name);
@ -1228,6 +1228,7 @@ static void seq_proxy_build_frame(Sequence * seq, int cfra, int render_size)
void seq_proxy_rebuild(Sequence * seq)
{
int cfra;
float rsize = seq->strip->proxy->size;
waitcursor(1);
@ -1245,6 +1246,8 @@ void seq_proxy_rebuild(Sequence * seq)
tse->flag &= ~STRIPELEM_PREVIEW_DONE;
}
/* a _lot_ faster for movie files, if we read frames in
sequential order */
if (seq->flag & SEQ_REVERSE_FRAMES) {
@ -1253,8 +1256,8 @@ void seq_proxy_rebuild(Sequence * seq)
TStripElem * tse = give_tstripelem(seq, cfra);
if (!(tse->flag & STRIPELEM_PREVIEW_DONE)) {
seq_proxy_build_frame(seq, cfra,
G.scene->r.size);
set_timecursor(cfra);
seq_proxy_build_frame(seq, cfra, rsize);
tse->flag |= STRIPELEM_PREVIEW_DONE;
}
if (blender_test_break()) {
@ -1267,8 +1270,8 @@ void seq_proxy_rebuild(Sequence * seq)
TStripElem * tse = give_tstripelem(seq, cfra);
if (!(tse->flag & STRIPELEM_PREVIEW_DONE)) {
seq_proxy_build_frame(seq, cfra,
G.scene->r.size);
set_timecursor(cfra);
seq_proxy_build_frame(seq, cfra, rsize);
tse->flag |= STRIPELEM_PREVIEW_DONE;
}
if (blender_test_break()) {
@ -1959,7 +1962,7 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra,
} else if (se->ibuf==NULL && sce_valid) {
/* no need to display a waitcursor on sequencer
scene strips */
if (!(sce->r.scemode & R_DOSEQ))
if (!(sce->r.scemode & R_DOSEQ) && !build_proxy_run)
waitcursor(1);
/* Hack! This function can be called from do_render_seq(), in that case
@ -2012,7 +2015,8 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra,
G.scene->r.scemode |= doseq;
if((G.f & G_PLAYANIM)==0 /* bad, is set on do_render_seq */
&& !(sce->r.scemode & R_DOSEQ))
&& !(sce->r.scemode & R_DOSEQ)
&& !build_proxy_run)
waitcursor(0);
CFRA = oldcfra;
@ -3111,7 +3115,7 @@ void do_render_seq(RenderResult *rr, int cfra)
recurs_depth++;
ibuf= give_ibuf_seq(rr->rectx, rr->recty, cfra, 0, G.scene->r.size);
ibuf= give_ibuf_seq(rr->rectx, rr->recty, cfra, 0, 100.0);
recurs_depth--;