diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/render/render_internal.cc | 10 | ||||
-rw-r--r-- | source/blender/render/RE_pipeline.h | 3 | ||||
-rw-r--r-- | source/blender/render/intern/pipeline.c | 12 | ||||
-rw-r--r-- | source/blender/sequencer/intern/render.c | 2 |
4 files changed, 21 insertions, 6 deletions
diff --git a/source/blender/editors/render/render_internal.cc b/source/blender/editors/render/render_internal.cc index 33b68dfb47b..6c04523ed07 100644 --- a/source/blender/editors/render/render_internal.cc +++ b/source/blender/editors/render/render_internal.cc @@ -355,7 +355,14 @@ static int screen_render_exec(bContext *C, wmOperator *op) scene->r.frame_step); } else { - RE_RenderFrame(re, mainp, scene, single_layer, camera_override, scene->r.cfra, is_write_still); + RE_RenderFrame(re, + mainp, + scene, + single_layer, + camera_override, + scene->r.cfra, + scene->r.subframe, + is_write_still); } RE_SetReports(re, nullptr); @@ -655,6 +662,7 @@ static void render_startjob(void *rjv, short *stop, short *do_update, float *pro rj->single_layer, rj->camera_override, rj->scene->r.cfra, + rj->scene->r.subframe, rj->write_still); } diff --git a/source/blender/render/RE_pipeline.h b/source/blender/render/RE_pipeline.h index f532c705534..21be690a56e 100644 --- a/source/blender/render/RE_pipeline.h +++ b/source/blender/render/RE_pipeline.h @@ -335,7 +335,8 @@ void RE_RenderFrame(struct Render *re, struct Scene *scene, struct ViewLayer *single_layer, struct Object *camera_override, - int frame, + const int frame, + const float subframe, bool write_still); /** * A version of #RE_RenderFrame that saves images to disk. diff --git a/source/blender/render/intern/pipeline.c b/source/blender/render/intern/pipeline.c index aa006713755..913a4d3857b 100644 --- a/source/blender/render/intern/pipeline.c +++ b/source/blender/render/intern/pipeline.c @@ -1844,7 +1844,8 @@ void RE_RenderFrame(Render *re, Scene *scene, ViewLayer *single_layer, Object *camera_override, - int frame, + const int frame, + const float subframe, const bool write_still) { render_callback_exec_id(re, re->main, &scene->id, BKE_CB_EVT_RENDER_INIT); @@ -1854,6 +1855,7 @@ void RE_RenderFrame(Render *re, G.is_rendering = true; scene->r.cfra = frame; + scene->r.subframe = subframe; if (render_init_from_main(re, &scene->r, bmain, scene, single_layer, camera_override, 0, 0)) { const RenderData rd = scene->r; @@ -2305,7 +2307,8 @@ void RE_RenderAnim(Render *re, const RenderData rd = scene->r; bMovieHandle *mh = NULL; - const int cfrao = rd.cfra; + const int cfra_old = rd.cfra; + const float subframe_old = rd.subframe; int nfra, totrendered = 0, totskipped = 0; const int totvideos = BKE_scene_multiview_num_videos_get(&rd); const bool is_movie = BKE_imtype_is_movie(rd.im_format.imtype); @@ -2373,6 +2376,7 @@ void RE_RenderAnim(Render *re, re->flag |= R_ANIMATION; { + scene->r.subframe = 0.0f; for (nfra = sfra, scene->r.cfra = sfra; scene->r.cfra <= efra; scene->r.cfra++) { char name[FILE_MAX]; @@ -2481,6 +2485,7 @@ void RE_RenderAnim(Render *re, } re->r.cfra = scene->r.cfra; /* weak.... */ + re->r.subframe = scene->r.subframe; /* run callbacks before rendering, before the scene is updated */ render_callback_exec_id(re, re->main, &scene->id, BKE_CB_EVT_RENDER_PRE); @@ -2549,7 +2554,8 @@ void RE_RenderAnim(Render *re, BKE_report(re->reports, RPT_INFO, "No frames rendered, skipped to not overwrite"); } - scene->r.cfra = cfrao; + scene->r.cfra = cfra_old; + scene->r.subframe = subframe_old; re->flag &= ~R_ANIMATION; diff --git a/source/blender/sequencer/intern/render.c b/source/blender/sequencer/intern/render.c index e53ef34603d..3f4d1e875f3 100644 --- a/source/blender/sequencer/intern/render.c +++ b/source/blender/sequencer/intern/render.c @@ -1501,7 +1501,7 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, } RE_RenderFrame( - re, context->bmain, scene, have_comp ? NULL : view_layer, camera, frame, false); + re, context->bmain, scene, have_comp ? NULL : view_layer, camera, frame, 0.0f, false); /* restore previous state after it was toggled on & off by RE_RenderFrame */ G.is_rendering = is_rendering; |