diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-08-21 12:56:03 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-08-21 13:23:13 +0300 |
commit | 3bc09c1c1ec9c1699ac872bc643d3e38c250803f (patch) | |
tree | d9812280b0bf6e7f9b835d2e670063a26a9d4ffd /source/blender/makesrna/intern/rna_layer.c | |
parent | e7767ba6be99a85349975b8da37b8cb8b9a3d6a9 (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/makesrna/intern/rna_layer.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_layer.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c index e7a898b97ae..fc5e957bba6 100644 --- a/source/blender/makesrna/intern/rna_layer.c +++ b/source/blender/makesrna/intern/rna_layer.c @@ -184,10 +184,7 @@ static PointerRNA rna_ViewLayer_depsgraph_get(PointerRNA *ptr) if (GS(id->name) == ID_SCE) { Scene *scene = (Scene *)id; ViewLayer *view_layer = (ViewLayer *)ptr->data; - // NOTE: We don't allocate new depsgraph here, so the bmain is ignored. So it's easier to pass - // NULL. - // Still weak though. - Depsgraph *depsgraph = BKE_scene_get_depsgraph(NULL, scene, view_layer, false); + Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer); return rna_pointer_inherit_refine(ptr, &RNA_Depsgraph, depsgraph); } return PointerRNA_NULL; @@ -206,7 +203,7 @@ static void rna_ViewLayer_update_tagged(ID *id_ptr, ReportList *reports) { Scene *scene = (Scene *)id_ptr; - Depsgraph *depsgraph = BKE_scene_get_depsgraph(bmain, scene, view_layer, true); + Depsgraph *depsgraph = BKE_scene_ensure_depsgraph(bmain, scene, view_layer); if (DEG_is_evaluating(depsgraph)) { BKE_report(reports, RPT_ERROR, "Dependency graph update requested during evaluation"); |