diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-09-12 16:09:14 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-09-12 16:09:14 +0400 |
commit | c41bb7961f1eb39dc423949a0474dd63ced53c98 (patch) | |
tree | d2852203d3c4635636c7e309c72539c42d40616c /source/blender/editors/render/render_internal.c | |
parent | 8309f1c0de6f8a70f85e3f980f83a5513d61d898 (diff) |
Different implementation of patch #36430: use layer froms scene directly for
rendering, in case some script wants to set it in the render_pre callback. In
case of decoupled 3d view layers or local view it will still override this
though.
Diffstat (limited to 'source/blender/editors/render/render_internal.c')
-rw-r--r-- | source/blender/editors/render/render_internal.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 0d6e6fb5ac1..f59c5d6af8d 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -212,7 +212,7 @@ static int screen_render_exec(bContext *C, wmOperator *op) Image *ima; View3D *v3d = CTX_wm_view3d(C); Main *mainp = CTX_data_main(C); - unsigned int lay; + unsigned int lay_override; 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; @@ -226,7 +226,7 @@ static int screen_render_exec(bContext *C, wmOperator *op) } re = RE_NewRender(scene->id.name); - lay = (v3d) ? v3d->lay : scene->lay; + lay_override = (v3d && v3d->lay != scene->lay) ? v3d->lay : 0; G.is_break = FALSE; RE_test_break_cb(re, NULL, render_break); @@ -244,9 +244,9 @@ static int screen_render_exec(bContext *C, wmOperator *op) RE_SetReports(re, op->reports); if (is_animation) - RE_BlenderAnim(re, mainp, scene, camera_override, lay, scene->r.sfra, scene->r.efra, scene->r.frame_step); + RE_BlenderAnim(re, mainp, scene, camera_override, lay_override, scene->r.sfra, scene->r.efra, scene->r.frame_step); else - RE_BlenderFrame(re, mainp, scene, srl, camera_override, lay, scene->r.cfra, is_write_still); + RE_BlenderFrame(re, mainp, scene, srl, camera_override, lay_override, scene->r.cfra, is_write_still); RE_SetReports(re, NULL); @@ -265,7 +265,7 @@ typedef struct RenderJob { wmWindow *win; SceneRenderLayer *srl; struct Object *camera_override; - int lay; + int lay_override; bool v3d_override; short anim, write_still; Image *image; @@ -444,9 +444,9 @@ static void render_startjob(void *rjv, short *stop, short *do_update, float *pro RE_SetReports(rj->re, rj->reports); if (rj->anim) - RE_BlenderAnim(rj->re, rj->main, rj->scene, rj->camera_override, rj->lay, rj->scene->r.sfra, rj->scene->r.efra, rj->scene->r.frame_step); + RE_BlenderAnim(rj->re, rj->main, rj->scene, rj->camera_override, rj->lay_override, rj->scene->r.sfra, rj->scene->r.efra, rj->scene->r.frame_step); else - RE_BlenderFrame(rj->re, rj->main, rj->scene, rj->srl, rj->camera_override, rj->lay, rj->scene->r.cfra, rj->write_still); + RE_BlenderFrame(rj->re, rj->main, rj->scene, rj->srl, rj->camera_override, rj->lay_override, rj->scene->r.cfra, rj->write_still); RE_SetReports(rj->re, NULL); } @@ -651,7 +651,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even rj->win = CTX_wm_window(C); rj->srl = srl; rj->camera_override = camera_override; - rj->lay = scene->lay; + rj->lay_override = 0; rj->anim = is_animation; rj->write_still = is_write_still && !is_animation; rj->iuser.scene = scene; @@ -659,15 +659,15 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even rj->reports = op->reports; if (v3d) { - if (rj->lay != v3d->lay) { - rj->lay = v3d->lay; + if (scene->lay != v3d->lay) { + rj->lay_override = v3d->lay; rj->v3d_override = true; } else if (camera_override && camera_override != scene->camera) rj->v3d_override = true; if (v3d->localvd) - rj->lay |= v3d->localvd->lay; + rj->lay_override = scene->lay | v3d->localvd->lay; } /* setup job */ |