Merge remote-tracking branch 'origin/master' into blender2.8
authorDalai Felinto <dfelinto@gmail.com>
Thu, 29 Mar 2018 13:36:34 +0000 (10:36 -0300)
committerDalai Felinto <dfelinto@gmail.com>
Thu, 29 Mar 2018 13:36:34 +0000 (10:36 -0300)
Fix for T54437: Sequencer preview uses last updated scene

The fix started in master, moving EvaluationContext initialization
before we leave `deg_evaluate_on_refresh()`.

Upon merging master we can fix the actual issue which was to set
the EvaluationContext depsgraph even if the depsgraph was already updated.

1  2 
source/blender/depsgraph/intern/eval/deg_eval.cc

index f3b45303e35a59844b975bbc856ba00acde2f3b6,fc71b5ccb7baba8e5bf5bbd24e0e0ab39ea84719..1355e68097b4b65e2ba70cccfffd1d502e0cd3c0
@@@ -228,19 -249,22 +228,19 @@@ static void schedule_children(TaskPool 
   * \note Time sources should be all valid!
   */
  void deg_evaluate_on_refresh(EvaluationContext *eval_ctx,
 -                             Depsgraph *graph,
 -                             const unsigned int layers)
 +                             Depsgraph *graph)
  {
+       /* Set time for the current graph evaluation context. */
+       TimeSourceDepsNode *time_src = graph->find_time_source();
+       eval_ctx->ctime = time_src->cfra;
++      eval_ctx->depsgraph = (::Depsgraph *)graph;
++      eval_ctx->view_layer = DEG_get_evaluated_view_layer((::Depsgraph *)graph);
        /* Nothing to update, early out. */
        if (BLI_gset_len(graph->entry_tags) == 0) {
                return;
        }
 -      DEG_DEBUG_PRINTF(EVAL, "%s: layers:%u, graph->layers:%u\n",
 -                       __func__,
 -                       layers,
 -                       graph->layers);
        const bool do_time_debug = ((G.debug & G_DEBUG_DEPSGRAPH_TIME) != 0);
        const double start_time = do_time_debug ? PIL_check_seconds_timer() : 0;
-       /* Set time for the current graph evaluation context. */
-       TimeSourceDepsNode *time_src = graph->find_time_source();
-       eval_ctx->depsgraph = (::Depsgraph *)graph;
-       eval_ctx->view_layer = DEG_get_evaluated_view_layer((::Depsgraph *)graph);
-       eval_ctx->ctime = time_src->cfra;
        /* Set up evaluation context for depsgraph itself. */
        DepsgraphEvalState state;
        state.eval_ctx = eval_ctx;