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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-04-20 12:01:43 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-04-20 12:02:21 +0300
commit3b100c5a2a78b196eb7fe6fb559c1e5ea0c47e66 (patch)
tree70966c9ceb09539b38cc49a497b0190b0068a79e /source/blender/depsgraph/intern
parentbf63fee23efad5f321ad16e9e90290e8879cb614 (diff)
Depsgraph: Add utility functions to go from evaluated to original datablock
Diffstat (limited to 'source/blender/depsgraph/intern')
-rw-r--r--source/blender/depsgraph/intern/depsgraph_query.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc b/source/blender/depsgraph/intern/depsgraph_query.cc
index 3bffbf4d88e..63eb1f18281 100644
--- a/source/blender/depsgraph/intern/depsgraph_query.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query.cc
@@ -166,3 +166,19 @@ ID *DEG_get_evaluated_id(const Depsgraph *depsgraph, ID *id)
return id_node->id_cow;
}
+Object *DEG_get_original_object(Object *object)
+{
+ return (Object *)DEG_get_original_id(&object->id);
+}
+
+ID *DEG_get_original_id(ID *id)
+{
+ if (id == NULL) {
+ return NULL;
+ }
+ if (id->orig_id == NULL) {
+ return id;
+ }
+ BLI_assert((id->tag & LIB_TAG_COPY_ON_WRITE) != 0);
+ return (ID *)id->orig_id;
+}