diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-04-30 08:29:36 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-04-30 08:29:36 +0400 |
commit | abcdf9573afd4c7ca81d9b1a1f6767e0fe81bdf3 (patch) | |
tree | 95739a083c39adf6f53574715f02c14212b88761 /source/blender/editors | |
parent | 9b1e70140d07abd6fc0a5466a39eef355da66835 (diff) |
add back support for rendering local view camera.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/render/render_internal.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index ce434413a5f..3890eedeb57 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -421,6 +421,7 @@ static int screen_render_exec(bContext *C, wmOperator *op) unsigned int lay= (v3d)? v3d->lay: scene->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; 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."); @@ -446,9 +447,9 @@ static int screen_render_exec(bContext *C, wmOperator *op) seq_stripelem_cache_cleanup(); if(is_animation) - RE_BlenderAnim(re, mainp, scene, lay, scene->r.sfra, scene->r.efra, scene->r.frame_step, op->reports); + RE_BlenderAnim(re, mainp, scene, camera_override, lay, scene->r.sfra, scene->r.efra, scene->r.frame_step, op->reports); else - RE_BlenderFrame(re, mainp, scene, NULL, lay, scene->r.cfra, is_write_still); + RE_BlenderFrame(re, mainp, scene, NULL, camera_override, lay, scene->r.cfra, is_write_still); // no redraw needed, we leave state as we entered it ED_update_for_newframe(mainp, scene, CTX_wm_screen(C), 1); @@ -464,6 +465,7 @@ typedef struct RenderJob { Render *re; wmWindow *win; SceneRenderLayer *srl; + struct Object *camera_override; int lay; short anim, write_still; Image *image; @@ -590,9 +592,9 @@ static void render_startjob(void *rjv, short *stop, short *do_update, float *pro rj->progress= progress; if(rj->anim) - RE_BlenderAnim(rj->re, rj->main, rj->scene, rj->lay, rj->scene->r.sfra, rj->scene->r.efra, rj->scene->r.frame_step, rj->reports); + 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, rj->reports); else - RE_BlenderFrame(rj->re, rj->main, rj->scene, rj->srl, rj->lay, rj->scene->r.cfra, rj->write_still); + RE_BlenderFrame(rj->re, rj->main, rj->scene, rj->srl, rj->camera_override, rj->lay, rj->scene->r.cfra, rj->write_still); } static void render_endjob(void *rjv) @@ -679,12 +681,13 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) int jobflag; 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; /* only one render job at a time */ if(WM_jobs_test(CTX_wm_manager(C), scene)) return OPERATOR_CANCELLED; - if(!RE_is_rendering_allowed(scene, op->reports, render_error_reports)) { + if(!RE_is_rendering_allowed(scene, camera_override, op->reports, render_error_reports)) { return OPERATOR_CANCELLED; } @@ -761,6 +764,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) rj->scene= scene; rj->win= CTX_wm_window(C); rj->srl = srl; + rj->camera_override = camera_override; rj->lay = (v3d)? v3d->lay: scene->lay; rj->anim= is_animation; rj->write_still= is_write_still && !is_animation; |