Fix #29109: bpy.ops.render.render() with scene parameter missed compositing,
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 1 Nov 2011 14:51:44 +0000 (14:51 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 1 Nov 2011 14:51:44 +0000 (14:51 +0000)
previous bugfix needed a bit more refining.

source/blender/editors/render/render_internal.c

index 2f09583..9c38b1c 100644 (file)
@@ -223,20 +223,26 @@ static int screen_render_exec(bContext *C, wmOperator *op)
 {
        Scene *scene= CTX_data_scene(C);
        SceneRenderLayer *srl= NULL;
-       Render *re= RE_NewRender(scene->id.name);
+       Render *re;
        Image *ima;
        View3D *v3d= CTX_wm_view3d(C);
        Main *mainp= CTX_data_main(C);
-       unsigned int lay= (v3d)? v3d->lay: scene->lay;
+       unsigned int lay;
        const short is_animation= RNA_boolean_get(op->ptr, "animation");
        const short is_write_still= RNA_boolean_get(op->ptr, "write_still");
        struct Object *camera_override= v3d ? V3D_CAMERA_LOCAL(v3d) : NULL;
 
+       /* custom scene and single layer re-render */
+       screen_render_scene_layer_set(op, mainp, &scene, &srl);
+
        if(!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.imtype)) {
                BKE_report(op->reports, RPT_ERROR, "Can't write a single file with an animation format selected");
                return OPERATOR_CANCELLED;
        }
 
+       re= RE_NewRender(scene->id.name);
+       lay= (v3d)? v3d->lay: scene->lay;
+
        G.afbreek= 0;
        RE_test_break_cb(re, NULL, (int (*)(void *)) blender_test_break);
 
@@ -252,9 +258,6 @@ static int screen_render_exec(bContext *C, wmOperator *op)
 
        RE_SetReports(re, op->reports);
 
-       /* custom scene and single layer re-render */
-       screen_render_scene_layer_set(op, mainp, &scene, &srl);
-
        if(is_animation)
                RE_BlenderAnim(re, mainp, scene, camera_override, lay, scene->r.sfra, scene->r.efra, scene->r.frame_step);
        else