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-25 18:59:08 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-04-26 19:11:58 +0300
commit918359269824a081c5e5819c44bc8461f59ebd37 (patch)
tree8475c029a831663bc31b863f226fa2267ece475d /source/blender/makesdna/DNA_anim_types.h
parentc86be7345b5338544e32197ae7c852361f747a7c (diff)
Animation: Make it possible to keyframe to with copy-on-write
The issue was that every object tweak was doing a full copy of original datablock onto evaluated version, and was updating animation. This made it impossible to tweak properties which has keyframes. Proposed solution is to: - Always apply animation on frame change, and when object is explicitly tagged for animation update. This will store original DNA value of animated property in the f-curve. - When applying animation in other cases, we check original DNA value stored in f-curve with the actual original DNA property. If they differ, it means user started to tweak animated property, and we should skip animation. If the value is the same, we apply animation. This is just a first step towards proper final implementation, but seems to be the direction we want to take.
Diffstat (limited to 'source/blender/makesdna/DNA_anim_types.h')
-rw-r--r--source/blender/makesdna/DNA_anim_types.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h
index cea1a1cf40f..13656c543ce 100644
--- a/source/blender/makesdna/DNA_anim_types.h
+++ b/source/blender/makesdna/DNA_anim_types.h
@@ -488,11 +488,13 @@ typedef struct FCurve {
/* value cache + settings */
float curval; /* value stored from last time curve was evaluated (not threadsafe, debug display only!) */
+ /* Value which comes from original DNA ddatablock at a time f-curve was evaluated. */
+ float orig_dna_val;
short flag; /* user-editable settings for this curve */
short extend; /* value-extending mode for this curve (does not cover */
char auto_smoothing; /* auto-handle smoothing mode */
- char pad[7];
+ char pad[3];
/* RNA - data link */
int array_index; /* if applicable, the index of the RNA-array item to get */
@@ -960,6 +962,8 @@ typedef enum eAnimData_Flag {
typedef enum eAnimData_Recalc {
ADT_RECALC_DRIVERS = (1 << 0),
ADT_RECALC_ANIM = (1 << 1),
+ /* Only apply f-curve value if its original DNA value matches current DNA value. */
+ ADT_RECALC_CHECK_ORIG_DNA = (1 << 2),
ADT_RECALC_ALL = (ADT_RECALC_DRIVERS | ADT_RECALC_ANIM)
} eAnimData_Recalc;