diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-11-03 21:06:12 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-11-03 21:06:12 +0400 |
commit | 224c26f891cb2495a0d94a092e46f13784af6e6b (patch) | |
tree | 6e69625e8fb1e4b03e8ec40cc11275f21eae5cc3 /source/blender | |
parent | d53989bda6e5b30f41846554c3a68ee695b031f2 (diff) |
Fix #28998: sequence rendering with wrong progress bar
Show overall progress when doing sequence rendering. Nice for cases when
you're using sequencer to combine video strips only, without rendering
scenes and so. If scene strips are used in sequencer, per-frame rendering
would be used (because of scene rendering sets per-frame progress).
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/render/render_internal.c | 6 | ||||
-rw-r--r-- | source/blender/render/extern/include/RE_pipeline.h | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/pipeline.c | 14 |
3 files changed, 17 insertions, 5 deletions
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 9c38b1ce98f..cc1c8843015 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -503,6 +503,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) 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; + const char *name; /* only one render job at a time */ if(WM_jobs_test(CTX_wm_manager(C), scene)) @@ -577,7 +578,10 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) rj->reports= op->reports; /* setup job */ - steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), scene, "Render", jobflag); + if(RE_seq_render_active(scene, &scene->r)) name= "Sequence Render"; + else name= "Render"; + + steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), scene, name, jobflag); WM_jobs_customdata(steve, rj, render_freejob); WM_jobs_timer(steve, 0.2, NC_SCENE|ND_RENDER_RESULT, 0); WM_jobs_callbacks(steve, render_startjob, NULL, NULL, render_endjob); diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h index cbb2f17043c..fac3329bae0 100644 --- a/source/blender/render/extern/include/RE_pipeline.h +++ b/source/blender/render/extern/include/RE_pipeline.h @@ -249,6 +249,8 @@ float RE_filter_value(int type, float x); /* vector blur zbuffer method */ void RE_zbuf_accumulate_vecblur(struct NodeBlurData *nbd, int xsize, int ysize, float *newrect, float *imgrect, float *vecbufrect, float *zbufrect); +int RE_seq_render_active(struct Scene *scene, struct RenderData *rd); + /* shaded view or baking options */ #define RE_BAKE_LIGHT 0 /* not listed in rna_scene.c -> can't be enabled! */ #define RE_BAKE_ALL 1 diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 8d72be1684c..de5d037675e 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -2517,14 +2517,14 @@ static void renderresult_stampinfo(Render *re) RE_ReleaseResultImage(re); } -static int seq_render_active(Render *re) +int RE_seq_render_active(Scene *scene, RenderData *rd) { Editing *ed; Sequence *seq; - ed = re->scene->ed; + ed = scene->ed; - if (!(re->r.scemode & R_DOSEQ) || !ed || !ed->seqbase.first) + if (!(rd->scemode & R_DOSEQ) || !ed || !ed->seqbase.first) return 0; for (seq= ed->seqbase.first; seq; seq= seq->next) { @@ -2632,6 +2632,12 @@ static void do_render_seq(Render * re) /* just in case this flag went missing at some point */ re->r.scemode |= R_DOSEQ; + + /* set overall progress of sequence rendering */ + if(re->r.efra!=re->r.sfra) + re->progress(re->prh, (float)(cfra-re->r.sfra) / (re->r.efra-re->r.sfra)); + else + re->progress(re->prh, 1.0f); } /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ @@ -2649,7 +2655,7 @@ static void do_render_all_options(Render *re) if(RE_engine_render(re, 1)) { /* in this case external render overrides all */ } - else if(seq_render_active(re)) { + else if(RE_seq_render_active(re->scene, &re->r)) { /* note: do_render_seq() frees rect32 when sequencer returns float images */ if(!re->test_break(re->tbh)) do_render_seq(re); |