diff options
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 53b32bd7df8..6097aba4518 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -3262,6 +3262,14 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq // have_seq = (scene->r.scemode & R_DOSEQ) && scene->ed && scene->ed->seqbase.first); /* UNUSED */ have_comp = (scene->r.scemode & R_DOCOMP) && scene->use_nodes && scene->nodetree; + /* Get depsgraph and scene layer for the strip. */ + SceneLayer *scene_layer = BKE_scene_layer_from_scene_get(scene); + Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, scene_layer); + /* TODO(sergey): This is a temporary solution. */ + if (depsgraph == NULL) { + scene->depsgraph_legacy = depsgraph = DEG_graph_new(); + } + orig_data.scemode = scene->r.scemode; orig_data.cfra = scene->r.cfra; orig_data.subframe = scene->r.subframe; @@ -3311,10 +3319,10 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq /* opengl offscreen render */ context->eval_ctx->engine = RE_engines_find(scene->view_render.engine_id); - BKE_scene_update_for_newframe(context->eval_ctx, context->bmain, scene); + BKE_scene_graph_update_for_newframe(context->eval_ctx, depsgraph, context->bmain, scene); ibuf = sequencer_view3d_cb( /* set for OpenGL render (NULL when scrubbing) */ - context->eval_ctx, scene, BKE_scene_layer_from_scene_get(scene), camera, width, height, IB_rect, + context->eval_ctx, scene, scene_layer, camera, width, height, IB_rect, context->scene->r.seq_prev_type, (context->scene->r.seq_flag & R_SEQ_SOLID_TEX) != 0, use_gpencil, use_background, scene->r.alphamode, @@ -3344,7 +3352,7 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq if (re == NULL) re = RE_NewSceneRender(scene); - BKE_scene_update_for_newframe(context->eval_ctx, context->bmain, scene); + BKE_scene_graph_update_for_newframe(context->eval_ctx, depsgraph, context->bmain, scene); RE_BlenderFrame(re, context->bmain, scene, NULL, camera, scene->lay, frame, false); /* restore previous state after it was toggled on & off by RE_BlenderFrame */ @@ -3404,7 +3412,7 @@ finally: scene->r.subframe = orig_data.subframe; if (is_frame_update) { - BKE_scene_update_for_newframe(context->eval_ctx, context->bmain, scene); + BKE_scene_graph_update_for_newframe(context->eval_ctx, depsgraph, context->bmain, scene); } #ifdef DURIAN_CAMERA_SWITCH |