diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-06 17:38:17 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-06 17:40:23 +0300 |
commit | 4cdb4b9532c8151ec9f1caba7a764c4f5a334f30 (patch) | |
tree | 17ef56ee61cac93358bfe0802e2eb1976bcb33c2 /source/blender/depsgraph/DEG_depsgraph_query.h | |
parent | 958e00cebfe122fd0a0a144612361fc8632f981b (diff) |
Fix T64161: Crashing using undo and multiple windows
It is possible that dependency graph was not yet initialized,
so need to do NULL pointer check.
Diffstat (limited to 'source/blender/depsgraph/DEG_depsgraph_query.h')
-rw-r--r-- | source/blender/depsgraph/DEG_depsgraph_query.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/depsgraph/DEG_depsgraph_query.h b/source/blender/depsgraph/DEG_depsgraph_query.h index 3030bfb28b3..a7ada7f3cd0 100644 --- a/source/blender/depsgraph/DEG_depsgraph_query.h +++ b/source/blender/depsgraph/DEG_depsgraph_query.h @@ -79,6 +79,16 @@ void DEG_get_customdata_mask_for_object(const struct Depsgraph *graph, * one. Assert will happen if it's not. */ struct Scene *DEG_get_evaluated_scene(const struct Depsgraph *graph); +/* Similar to DEG_get_evaluated_scene(), but allows to access non-fully evaluated pointer without + * causing asserts or crashes. Works the following way: + * - If the scene was never evaluated NULL returned. + * - Otherwise the last known state of the scene is returned. + * + * Use in exceptional case if it's absolutely must to. + * + * Allows to pass depsgraph == NULL, wil lreturn NULL in that case. */ +struct Scene *DEG_get_evaluated_scene_if_exists(const struct Depsgraph *graph); + /* Get view layer at its evaluated state. * This is a shortcut for accessing active view layer from evaluated scene. */ struct ViewLayer *DEG_get_evaluated_view_layer(const struct Depsgraph *graph); |