diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-04-19 23:49:14 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-04-19 23:49:14 +0300 |
commit | 795f024558b83e5f414971be67079f66af375706 (patch) | |
tree | c981e34f9ca5dcd8bbdf4afe1a40b65abdd98bfe /source/blender/blenkernel/intern | |
parent | 2d1d6fbb235a11162f201b24c17b57656ae51863 (diff) | |
parent | 0566ebdebeeb658300e6c45b805075ada9c02c0a (diff) |
Merge branch 'blender-v2.93-release'
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 47b6817d429..e1f013eb589 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -2682,7 +2682,8 @@ static void scene_graph_update_tagged(Depsgraph *depsgraph, Main *bmain, bool on } /* Clear recalc flags for second pass, but back them up for editors update. */ - DEG_ids_clear_recalc(depsgraph, true); + const bool backup = true; + DEG_ids_clear_recalc(depsgraph, backup); used_multiple_passes = true; run_callbacks = false; } @@ -2691,7 +2692,11 @@ static void scene_graph_update_tagged(Depsgraph *depsgraph, Main *bmain, bool on if (used_multiple_passes) { DEG_ids_restore_recalc(depsgraph); } - DEG_editors_update(depsgraph, false); + const bool is_time_update = false; + DEG_editors_update(depsgraph, is_time_update); + + const bool backup = false; + DEG_ids_clear_recalc(depsgraph, backup); } void BKE_scene_graph_update_tagged(Depsgraph *depsgraph, Main *bmain) @@ -2705,10 +2710,9 @@ void BKE_scene_graph_evaluated_ensure(Depsgraph *depsgraph, Main *bmain) } /* applies changes right away, does all sets too */ -void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph) +void BKE_scene_graph_update_for_newframe_ex(Depsgraph *depsgraph, const bool clear_recalc) { Scene *scene = DEG_get_input_scene(depsgraph); - ViewLayer *view_layer = DEG_get_input_view_layer(depsgraph); Main *bmain = DEG_get_bmain(depsgraph); bool used_multiple_passes = false; @@ -2755,7 +2759,8 @@ void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph) } /* Clear recalc flags for second pass, but back them up for editors update. */ - DEG_ids_clear_recalc(depsgraph, true); + const bool backup = true; + DEG_ids_clear_recalc(depsgraph, backup); used_multiple_passes = true; } @@ -2763,7 +2768,21 @@ void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph) if (used_multiple_passes) { DEG_ids_restore_recalc(depsgraph); } - DEG_editors_update(depsgraph, true); + + const bool is_time_update = true; + DEG_editors_update(depsgraph, is_time_update); + + /* Clear recalc flags, can be skipped for e.g. renderers that will read these + * and clear the flags later. */ + if (clear_recalc) { + const bool backup = false; + DEG_ids_clear_recalc(depsgraph, backup); + } +} + +void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph) +{ + BKE_scene_graph_update_for_newframe_ex(depsgraph, true); } /** @@ -3523,8 +3542,8 @@ GHash *BKE_scene_undo_depsgraphs_extract(Main *bmain) for (Scene *scene = bmain->scenes.first; scene != NULL; scene = scene->id.next) { if (scene->depsgraph_hash == NULL) { - /* In some cases, e.g. when undo has to perform multiple steps at once, no depsgraph will be - * built so this pointer may be NULL. */ + /* In some cases, e.g. when undo has to perform multiple steps at once, no depsgraph will + * be built so this pointer may be NULL. */ continue; } for (ViewLayer *view_layer = scene->view_layers.first; view_layer != NULL; |