Merged changes in the trunk up to revision 54110.
[blender.git] / source / blender / render / intern / source / pipeline.c
index e37b24b13a44174c5decac4a667b65ffdf9b32d9..866932632c27b06152feaaa82fa1208dcb758c5d 100644 (file)
@@ -474,7 +474,7 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, SceneRenderLayer *
                re->recty = winy;
        }
        
-       if (re->rectx < 2 || re->recty < 2 || (BKE_imtype_is_movie(rd->im_format.imtype) &&
+       if (re->rectx < 1 || re->recty < 1 || (BKE_imtype_is_movie(rd->im_format.imtype) &&
                                               (re->rectx < 16 || re->recty < 16) ))
        {
                BKE_report(re->reports, RPT_ERROR, "Image too small");
@@ -1879,6 +1879,8 @@ static void do_render_all_options(Render *re)
        /* ensure no images are in memory from previous animated sequences */
        BKE_image_all_free_anim_ibufs(re->r.cfra);
 
+       re->pool = BKE_image_pool_new();
+
        if (RE_engine_render(re, 1)) {
                /* in this case external render overrides all */
        }
@@ -1903,6 +1905,9 @@ static void do_render_all_options(Render *re)
                renderresult_stampinfo(re);
                re->display_draw(re->ddh, re->result, NULL);
        }
+
+       BKE_image_pool_free(re->pool);
+       re->pool = NULL;
 }
 
 static int check_valid_camera(Scene *scene, Object *camera_override)
@@ -2488,6 +2493,8 @@ void RE_PreviewRender(Render *re, Main *bmain, Scene *sce)
 
        RE_InitState(re, NULL, &sce->r, NULL, winx, winy, NULL);
 
+       re->pool = BKE_image_pool_new();
+
        re->main = bmain;
        re->scene = sce;
        re->scene_color_manage = BKE_scene_check_color_management_enabled(sce);
@@ -2497,6 +2504,9 @@ void RE_PreviewRender(Render *re, Main *bmain, Scene *sce)
        RE_SetCamera(re, camera);
 
        do_render_3d(re);
+
+       BKE_image_pool_free(re->pool);
+       re->pool = NULL;
 }
 
 /* note; repeated win/disprect calc... solve that nicer, also in compo */