diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-09-04 14:01:22 +0300 |
---|---|---|
committer | YimingWu <xp8110@outlook.com> | 2019-09-12 04:14:21 +0300 |
commit | e064aa25609f44bd9c970d252a643e5870611aa6 (patch) | |
tree | c8c5cecf197e93b814f4e1c841918a4fbca7320b /source/blender/blenkernel | |
parent | 6b1771645e704d57242cf98021f1c44896bc4c23 (diff) |
Depsgraph: Pass bmain to evaluation function
Currently unused, makes code ready for an upcoming change.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 6392a5df1d2..7b5186a111d 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1474,7 +1474,26 @@ static void scene_graph_update_tagged(Depsgraph *depsgraph, Main *bmain, bool on break; } - run_callbacks = false; + /* TODO(sergey): Some functions here are changing global state, + * for example, clearing update tags from bmain. + */ + /* (Re-)build dependency graph if needed. */ + DEG_graph_relations_update(depsgraph, bmain, scene, view_layer); + /* Uncomment this to check if graph was properly tagged for update. */ + // DEG_debug_graph_relations_validate(depsgraph, bmain, scene); + /* Flush editing data if needed. */ + prepare_mesh_for_viewport_render(bmain, view_layer); + /* Flush recalc flags to dependencies. */ + DEG_graph_flush_update(bmain, depsgraph); + /* Update all objects: drivers, matrices, displists, etc. flags set + * by depgraph or manual, no layer check here, gets correct flushed. + */ + DEG_evaluate_on_refresh(bmain, depsgraph); + /* Update sound system. */ + BKE_scene_update_sound(depsgraph, bmain); + /* Notify python about depsgraph update. */ + if (run_callbacks) { + BLI_callback_exec(bmain, &scene->id, BLI_CB_EVT_DEPSGRAPH_UPDATE_POST); } } |