== Sequencer ==
authorPeter Schlaile <peter@schlaile.de>
Sun, 14 Jun 2009 18:54:35 +0000 (18:54 +0000)
committerPeter Schlaile <peter@schlaile.de>
Sun, 14 Jun 2009 18:54:35 +0000 (18:54 +0000)
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 :) )

source/blender/blenkernel/BKE_blender.h
source/blender/blenloader/intern/readfile.c
source/blender/makesdna/DNA_sequence_types.h
source/blender/src/buttons_scene.c
source/blender/src/drawseq.c
source/blender/src/header_seq.c
source/blender/src/sequence.c

index 5513f98b2990d615a1527d0a439de2c81adb6433..30e68b83149e88a9e0e4896ca5b967b16ebe0b05 100644 (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
index 38b8bfaaa882c0b78dd8e16eeb21598feb47dd7e..c4d63cf14fd9af591d89890e4b383eff6a10fa1c 100644 (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! */
index ed1626c887f8eb70867f45f9f46d78ea4bf3b2cc..b6815df9fc5dcbfdd5a14eb69d4b4b327a14cc00 100644 (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 {
index 532ecad249f3ea5511e91c415e986d60d8c584df..d0df532a8248a32ceedbee01cca2b8fd0901dbc3 100644 (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");
-               }
+       if (!(last_seq->flag & SEQ_USE_PROXY)) {
+               uiBlockEndAlign(block);
+               return;
+       }
 
-               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");
+       if (!last_seq->strip->proxy) {
+               last_seq->strip->proxy = 
+                       MEM_callocN(sizeof(struct StripProxy),
+                                   "StripProxy");
+       }
 
-               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");
+       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");
 
-               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");
+       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;
 
-                       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!)");
+               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, "");
+       }
 
-                       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_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) {
-               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->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);
+
 }
 
 
index 7fd7d8880a10ee34bb7bddc29ae089b890267024..2ff26d755952c582fdee79c8710cd9efe5026e01 100644 (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);
        }
 }
 
index 23712b93b50c7a61b2ae2b378aeda60a7d79cd46..5b117fb2273d5af6bd64aeff99d09e376c14f4f4 100644 (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");
 
index 44661b5fa91ae9e6910abba91e62b7e293a481ff..5a63e3ea995694943cff15ee99720c667e3422bf 100644 (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--;