[Bf-blender-cvs] [c991bb0baf6] blender2.8: Depsgraph: Allow querying NULL IDs for evaluated version
Sergey Sharybin
noreply at git.blender.org
Tue Apr 17 13:49:36 CEST 2018
Commit: c991bb0baf60a1bd2ab73dc5ccaf086d95c16955
Author: Sergey Sharybin
Date: Tue Apr 17 13:48:39 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBc991bb0baf60a1bd2ab73dc5ccaf086d95c16955
Depsgraph: Allow querying NULL IDs for evaluated version
Saves us from extra checks for NULL pointers when using datablocks for read.
===================================================================
M source/blender/depsgraph/intern/depsgraph_query.cc
===================================================================
diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc b/source/blender/depsgraph/intern/depsgraph_query.cc
index 6f0ba26c8f7..3bffbf4d88e 100644
--- a/source/blender/depsgraph/intern/depsgraph_query.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query.cc
@@ -151,6 +151,9 @@ Object *DEG_get_evaluated_object(const Depsgraph *depsgraph, Object *object)
ID *DEG_get_evaluated_id(const Depsgraph *depsgraph, ID *id)
{
+ if (id == NULL) {
+ return NULL;
+ }
/* TODO(sergey): This is a duplicate of Depsgraph::get_cow_id(),
* but here we never do assert, since we don't know nature of the
* incoming ID datablock.
More information about the Bf-blender-cvs
mailing list