Sequencer now outputs float buffers to render too, when available.
authorTon Roosendaal <ton@blender.org>
Sun, 12 Mar 2006 19:00:48 +0000 (19:00 +0000)
committerTon Roosendaal <ton@blender.org>
Sun, 12 Mar 2006 19:00:48 +0000 (19:00 +0000)
source/blender/render/intern/source/pipeline.c
source/blender/src/sequence.c

index 5c8b292ec14571fb4537e2e250b0a9be568ecb04..5848ec4e3926d3c448fe55a5dd7fb39f2d576b3d 100644 (file)
@@ -1305,9 +1305,6 @@ static void do_render_final(Render *re)
        re->i.starttime= PIL_check_seconds_timer();
 
        if(re->r.scemode & R_DOSEQ) {
-               if (!re->result->rect32) {
-                       re->result->rect32= MEM_callocT(sizeof(int)*re->rectx*re->recty, "do_render_final rectot");
-               }
                if(!re->test_break()) 
                        do_render_seq(re->result, re->r.cfra);
        }
index 71c258bf3f61ae71f8224b464cd91094a68eea4b..730889b73a922519d19daa3caba3a9146a844508 100644 (file)
@@ -1279,7 +1279,7 @@ void free_imbuf_seq()
        END_SEQ
 }
 
-/* bad levell call... renderer makes a 32 bits rect to put result in */
+/* bad levell call... */
 void do_render_seq(RenderResult *rr, int cfra)
 {
        ImBuf *ibuf;
@@ -1287,20 +1287,32 @@ void do_render_seq(RenderResult *rr, int cfra)
        G.f |= G_PLAYANIM;      /* waitcursor patch */
 
        ibuf= give_ibuf_seq(rr->rectx, rr->recty, cfra, 0);
-       if(ibuf && rr->rect32) {
-               printf("copied\n");
-               memcpy(rr->rect32, ibuf->rect, 4*rr->rectx*rr->recty);
+       
+       if(ibuf) {
+               
+               if(ibuf->rect_float) {
+                       if (!rr->rectf)
+                               rr->rectf= MEM_mallocN(4*sizeof(float)*rr->rectx*rr->recty, "render_seq rectf");
+                       
+                       memcpy(rr->rectf, ibuf->rect_float, 4*sizeof(float)*rr->rectx*rr->recty);
+               }
+               else if(ibuf->rect) {
+                       if (!rr->rect32)
+                               rr->rect32= MEM_mallocN(sizeof(int)*rr->rectx*rr->recty, "render_seq rect");
 
-               /* if (ibuf->zbuf) { */
-               /*      if (R.rectz) freeN(R.rectz); */
-               /*      R.rectz = BLI_dupallocN(ibuf->zbuf); */
-               /* } */
+                       memcpy(rr->rect32, ibuf->rect, 4*rr->rectx*rr->recty);
 
+                       /* if (ibuf->zbuf) { */
+                       /*      if (R.rectz) freeN(R.rectz); */
+                       /*      R.rectz = BLI_dupallocN(ibuf->zbuf); */
+                       /* } */
+               }
+               
                /* Let the cache limitor take care of this (schlaile) */
-               /* no, doesnt seem to work for float buffer? (ton) */
+               /* While render let's keep all memory available for render (ton) */
                free_imbuf_seq_except(cfra);
-               
        }
+       
        G.f &= ~G_PLAYANIM;
 
 }