Merged changes in the trunk up to revision 25613.
[blender.git] / source / blender / editors / screen / screen_ops.c
index d58e85030014b47e3898df45952f258f1e8402ca..9db9247287c1e6fcd1a61964999a926eddc60576 100644 (file)
@@ -2813,7 +2813,7 @@ static int screen_render_exec(bContext *C, wmOperator *op)
        FRS_set_context(C);
 
        if(RNA_boolean_get(op->ptr, "animation"))
-               RE_BlenderAnim(re, scene, scene->r.sfra, scene->r.efra, scene->r.frame_step);
+               RE_BlenderAnim(re, scene, scene->r.sfra, scene->r.efra, scene->r.frame_step, op->reports);
        else
                RE_BlenderFrame(re, scene, scene->r.cfra);
        
@@ -2834,6 +2834,7 @@ typedef struct RenderJob {
        ImageUser iuser;
        short *stop;
        short *do_update;
+       ReportList *reports;
 } RenderJob;
 
 static void render_freejob(void *rjv)
@@ -3038,7 +3039,7 @@ static void render_startjob(void *rjv, short *stop, short *do_update)
 #endif
        
        if(rj->anim)
-               RE_BlenderAnim(rj->re, rj->scene, rj->scene->r.sfra, rj->scene->r.efra, rj->scene->r.frame_step);
+               RE_BlenderAnim(rj->re, rj->scene, rj->scene->r.sfra, rj->scene->r.efra, rj->scene->r.frame_step, rj->reports);
        else
                RE_BlenderFrame(rj->re, rj->scene, rj->scene->r.cfra);
 }
@@ -3114,6 +3115,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
        rj->anim= RNA_boolean_get(op->ptr, "animation");
        rj->iuser.scene= scene;
        rj->iuser.ok= 1;
+       rj->reports= op->reports;
        
        /* setup job */
        steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), scene, WM_JOB_EXCL_RENDER|WM_JOB_PRIORITY);
@@ -3145,8 +3147,6 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
        
        WM_jobs_start(CTX_wm_manager(C), steve);
        
-       G.afbreek= 0;
-       
        WM_cursor_wait(0);
        WM_event_add_notifier(C, NC_SCENE|ND_RENDER_RESULT, scene);
        
@@ -3191,6 +3191,7 @@ typedef struct OGLRender {
        GPUOffScreen *ofs;
        int sizex, sizey;
        
+       ReportList *reports;
        bMovieHandle *mh;
        int cfrao, nfra;
        
@@ -3389,9 +3390,9 @@ static int screen_opengl_render_modal(bContext *C, wmOperator *op, wmEvent *even
        
        if(ibuf) {
                if(BKE_imtype_is_movie(scene->r.imtype)) {
-                       oglrender->mh->append_movie(&scene->r, CFRA, (int*)ibuf->rect, oglrender->sizex, oglrender->sizey);
-                       printf("Append frame %d", scene->r.cfra);
-                       ok= 1;
+                       ok= oglrender->mh->append_movie(&scene->r, CFRA, (int*)ibuf->rect, oglrender->sizex, oglrender->sizey, oglrender->reports);
+                       if(ok)
+                               printf("Append frame %d", scene->r.cfra);
                }
                else {
                        BKE_makepicstring(scene, name, scene->r.pic, scene->r.cfra, scene->r.imtype);
@@ -3445,9 +3446,14 @@ static int screen_opengl_render_invoke(bContext *C, wmOperator *op, wmEvent *eve
                oglrender= op->customdata;
                scene= oglrender->scene;
                
+               oglrender->reports= op->reports;
                oglrender->mh= BKE_get_movie_handle(scene->r.imtype);
-               if(BKE_imtype_is_movie(scene->r.imtype))
-                       oglrender->mh->start_movie(scene, &scene->r, oglrender->sizex, oglrender->sizey);
+               if(BKE_imtype_is_movie(scene->r.imtype)) {
+                       if(!oglrender->mh->start_movie(scene, &scene->r, oglrender->sizex, oglrender->sizey, oglrender->reports)) {
+                               screen_opengl_render_end(C, oglrender);
+                               return OPERATOR_CANCELLED;
+                       }
+               }
                
                oglrender->cfrao= scene->r.cfra;
                oglrender->nfra= SFRA;