WIP COW Fix: Insert keyframe operators/api now queries depsgraph for evaluated data
authorJoshua Leung <aligorith@gmail.com>
Fri, 18 May 2018 18:36:48 +0000 (20:36 +0200)
committerJoshua Leung <aligorith@gmail.com>
Sat, 19 May 2018 17:54:47 +0000 (19:54 +0200)
commit6ba28ff8b1658d69e2f4c1c92a8eeec230f573ba
tree003c742d994f8a05d3dba96444d2aac0e7a9cdd5
parent06737a82584c6be60a25b5f289e3fcd5c26b7aac
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!
15 files changed:
source/blender/depsgraph/DEG_depsgraph_query.h
source/blender/depsgraph/intern/depsgraph_query.cc
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/keyframing.c
source/blender/editors/animation/keyingsets.c
source/blender/editors/armature/pose_utils.c
source/blender/editors/gpencil/gpencil_convert.c
source/blender/editors/include/ED_anim_api.h
source/blender/editors/include/ED_keyframing.h
source/blender/editors/interface/interface_anim.c
source/blender/editors/space_action/action_edit.c
source/blender/editors/space_graph/graph_edit.c
source/blender/editors/transform/transform_conversions.c
source/blender/python/intern/bpy_rna_anim.c