diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-07 18:29:31 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-07 18:36:25 +0300 |
commit | ba1197fe5e27f1cb7be281b3f20166a69050a273 (patch) | |
tree | d2852f12af386701db2f3c8dddf96b185efb248e /source/blender/blenkernel/intern/scene.c | |
parent | f16199d479189f1f142aebecf896182a7276c483 (diff) |
Depsgraph: Simplify some workarounds and make API closer to final
Diffstat (limited to 'source/blender/blenkernel/intern/scene.c')
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 9583719dca9..4b2e7eff866 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -2453,8 +2453,14 @@ void BKE_scene_free_depsgraph_hash(Scene *scene) /* Query depsgraph for a specific contexts. */ -Depsgraph *BKE_scene_get_depsgraph(Scene *scene, SceneLayer *scene_layer) +Depsgraph *BKE_scene_get_depsgraph(Scene *scene, + SceneLayer *scene_layer, + bool allocate) { (void) scene_layer; - return scene->depsgraph_legacy; + Depsgraph *depsgraph = scene->depsgraph_legacy; + if (depsgraph == NULL && allocate) { + scene->depsgraph_legacy = depsgraph = DEG_graph_new(); + } + return depsgraph; } |