diff options
author | Joshua Leung <aligorith@gmail.com> | 2018-05-18 21:36:48 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2018-05-19 20:54:47 +0300 |
commit | 6ba28ff8b1658d69e2f4c1c92a8eeec230f573ba (patch) | |
tree | 003c742d994f8a05d3dba96444d2aac0e7a9cdd5 /source/blender/depsgraph/DEG_depsgraph_query.h | |
parent | 06737a82584c6be60a25b5f289e3fcd5c26b7aac (diff) |
WIP COW Fix: Insert keyframe operators/api now queries depsgraph for evaluated data
When using copy on write, insert keyframe operators were reading from old
bmain data instead of COW data. This meant that inserting keyframes would
often read old/stale data, resulting in invalid keyframes getting created
(e.g. from last transform operation, instead of actual current state).
This commit makes it so that keyframing operators will ask depsgraph for
the evaluated copy of the data, so that it can read values from that. It
introduces a new function - `DEG_get_evaluated_rna_pointer()`, which when
working correctly/fully, should work just like the other `DEG_get_evaluated_*()`
functions, except it lets you pass in an RNA Pointer.
However, currently, this is only done for Pose Bones (as a dirty hack, since this
is an important/pivotal requirement for production) and/or datablock
properties directly (since we can just use the DEG_get_evaluated_id() directly).
on the datablock.
Committing to a branch for now as this all needs more testing. More work to come
later at a more sane time of day!
Diffstat (limited to 'source/blender/depsgraph/DEG_depsgraph_query.h')
-rw-r--r-- | source/blender/depsgraph/DEG_depsgraph_query.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/depsgraph/DEG_depsgraph_query.h b/source/blender/depsgraph/DEG_depsgraph_query.h index 6d21c143877..e77bf62bab6 100644 --- a/source/blender/depsgraph/DEG_depsgraph_query.h +++ b/source/blender/depsgraph/DEG_depsgraph_query.h @@ -85,6 +85,10 @@ struct Object *DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct ID *DEG_get_evaluated_id(const struct Depsgraph *depsgraph, struct ID *id); +/* Get evaluated version of data pointed to by RNA pointer */ +void DEG_get_evaluated_rna_pointer(const struct Depsgraph *depsgraph, + const struct PointerRNA *ptr, + struct PointerRNA *r_ptr_eval); /* Get original version of object for given evaluated one. */ struct Object *DEG_get_original_object(struct Object *object); |