Bug fix #1939
authorTon Roosendaal <ton@blender.org>
Thu, 2 Dec 2004 18:12:18 +0000 (18:12 +0000)
committerTon Roosendaal <ton@blender.org>
Thu, 2 Dec 2004 18:12:18 +0000 (18:12 +0000)
Combining panorama scene and Sequencer effect on scene (like glow) crashed.

Found two other issues;

- on click in sequencer, the image output window didn't redraw correct, but
  only when a render window was opened. Caused by missing 'activate' call
- added a pause in dragging-frame loop to make it idle friendly

source/blender/render/intern/source/initrender.c
source/blender/src/drawseq.c
source/blender/src/sequence.c
source/blender/src/space.c

index c5e319d19b9ebecfc5bad7dbe1abd1a06662b130..a4d908ac70525f26ccb4b080ca8f3ce1bfdd5428 100644 (file)
@@ -1193,6 +1193,9 @@ void RE_initrender(struct View3D *ogl_render_view3d)
        if(R.r.scemode & R_DOSEQ) {
                R.rectx= R.r.xsch;
                R.recty= R.r.ysch;
+               if(R.r.mode & R_PANORAMA) {
+                       R.rectx*= R.r.xparts;
+               }
                
                if(R.rectot) MEM_freeN(R.rectot);
                R.rectot= (unsigned int *)MEM_callocN(sizeof(int)*R.rectx*R.recty, "rectot");
index fdc9f5e2e66af37dbe2adbe79a00f97ee839cf72..a5aba43f502c1d0f8ad9bc1cc3e58d126e261fa6 100644 (file)
@@ -468,7 +468,7 @@ void set_special_seq_update(int val)
 }
 
 
-static void draw_image_seq(void)
+static void draw_image_seq(ScrArea *sa)
 {
        SpaceSeq *sseq;
        StripElem *se;
@@ -478,8 +478,6 @@ static void draw_image_seq(void)
        glClearColor(0.0, 0.0, 0.0, 0.0);
        glClear(GL_COLOR_BUFFER_BIT);
 
-       curarea->win_swap= WIN_BACK_OK;
-
        ibuf= (ImBuf *)give_ibuf_seq( (G.scene->r.cfra));
 
        if(special_seq_update) {
@@ -494,17 +492,18 @@ static void draw_image_seq(void)
        }
        if(ibuf==0 || ibuf->rect==0) return;
 
-       sseq= curarea->spacedata.first;
+       sseq= sa->spacedata.first;
        if(sseq==0) return;
 
        /* calc location */
-       x1= curarea->winrct.xmin+(curarea->winx-sseq->zoom*ibuf->x)/2;
-       y1= curarea->winrct.ymin+(curarea->winy-sseq->zoom*ibuf->y)/2;
+       x1= sa->winrct.xmin+(sa->winx-sseq->zoom*ibuf->x)/2;
+       y1= sa->winrct.ymin+(sa->winy-sseq->zoom*ibuf->y)/2;
 
-       rectwrite_part(curarea->winrct.xmin, curarea->winrct.ymin,
-                               curarea->winrct.xmax, curarea->winrct.ymax,
+       rectwrite_part(sa->winrct.xmin, sa->winrct.ymin,
+                               sa->winrct.xmax, sa->winrct.ymax,
                                x1, y1, ibuf->x, ibuf->y, (float)sseq->zoom,(float)sseq->zoom, ibuf->rect);
 
+       sa->win_swap= WIN_BACK_OK;
 }
 
 static void draw_extra_seqinfo(void)
@@ -777,7 +776,8 @@ void drawseqspace(ScrArea *sa, void *spacedata)
 
        sseq= curarea->spacedata.first;
        if(sseq->mainb==1) {
-               draw_image_seq();
+               draw_image_seq(curarea);
+               curarea->win_swap= WIN_BACK_OK;
                return;
        }
 
index 1b1fd50b8ea585cb4669978d3e58ae3394f5b94e..6489a0fde52f5a72676e03dd45c5711e68b789f7 100644 (file)
 #include "BKE_scene.h"
 #include "BKE_ipo.h"
 
-#include "BIF_screen.h"
-#include "BIF_interface.h"
-#include "BIF_toolbox.h"
 #include "BSE_filesel.h"
+#include "BIF_interface.h"
 #include "BSE_headerbuttons.h"
+#include "BIF_screen.h"
+#include "BIF_space.h"
+#include "BIF_toolbox.h"
+
 #include "BSE_sequence.h"
 
 #include "blendef.h"
@@ -1953,6 +1955,7 @@ void do_build_seqar_cfra(ListBase *seqbase, Sequence ***seqar, int cfra)
 
                                                RE_initrender(NULL);
                                                if (!G.background) {
+                                                       mainwindow_make_active();
                                                        if(R.r.mode & R_FIELDS) update_for_newframe_muted();
                                                        R.flag= 0;
 
index 6a07a1bd0c072a100012948be48fc8c6b27a5da0..29d4294db73050befa6a292fd253c7c71301746b 100644 (file)
@@ -3126,6 +3126,7 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                                force_draw(0);
                                                update_for_newframe();  /* for audio scrubbing */                                               
                                        }
+                                       else PIL_sleep_ms(30);
                                
                                } while(get_mbut() & mousebut);