Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2020-08-21 12:56:03 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-08-21 13:23:13 +0300
commit3bc09c1c1ec9c1699ac872bc643d3e38c250803f (patch)
treed9812280b0bf6e7f9b835d2e670063a26a9d4ffd /source/blender/blenkernel/BKE_scene.h
parente7767ba6be99a85349975b8da37b8cb8b9a3d6a9 (diff)
Cleanup: split `BKE_scene_get_depsgraph()` into two functions
Split the depsgraph allocation into a separate function `BKE_scene_ensure_depsgraph()`. Parameters are only passed to those functions that actually need them. This removes the the "if that boolean is `false` this pointer is allowed to be `NULL`" logic and more cleanly decouples code. No functional changes.
Diffstat (limited to 'source/blender/blenkernel/BKE_scene.h')
-rw-r--r--source/blender/blenkernel/BKE_scene.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h
index 2a5e4527676..05966ec3989 100644
--- a/source/blender/blenkernel/BKE_scene.h
+++ b/source/blender/blenkernel/BKE_scene.h
@@ -219,10 +219,12 @@ void BKE_scene_ensure_depsgraph_hash(struct Scene *scene);
void BKE_scene_free_depsgraph_hash(struct Scene *scene);
void BKE_scene_free_view_layer_depsgraph(struct Scene *scene, struct ViewLayer *view_layer);
-struct Depsgraph *BKE_scene_get_depsgraph(struct Main *bmain,
- struct Scene *scene,
- struct ViewLayer *view_layer,
- bool allocate);
+/* Do not allocate new depsgraph. */
+struct Depsgraph *BKE_scene_get_depsgraph(struct Scene *scene, struct ViewLayer *view_layer);
+/* Allocate new depsgraph if necessary. */
+struct Depsgraph *BKE_scene_ensure_depsgraph(struct Main *bmain,
+ struct Scene *scene,
+ struct ViewLayer *view_layer);
struct GHash *BKE_scene_undo_depsgraphs_extract(struct Main *bmain);
void BKE_scene_undo_depsgraphs_restore(struct Main *bmain, struct GHash *depsgraph_extract);