diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2018-11-12 19:41:53 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2018-12-14 22:19:18 +0300 |
commit | de662e7cd3b3ca45c4220e3830c32e2b3496c9fe (patch) | |
tree | 79b78cc746c5121ac4c964dffef94d961fd14975 /source/blender/blenkernel/nla_private.h | |
parent | fc74903f272a01784e0376c9ee12c2673017285d (diff) |
NLA: insert keyframes correctly for strips with non-Replace mode.
NLA strips support using the keyframe values in a variety of ways:
adding, subtracting, multiplying, linearly mixing with the result
of strips located below in the stack. This is intended for layering
tweaks on top of a base animation.
However, when inserting keyframes into such strips, it simply inserts
the final value of the property, irrespective of these settings. This
in fact makes the feature nearly useless.
To fix this it is necessary to evaluate the NLA stack below the
edited strip and correctly compute the raw key that would produce
the intended final value, according to the mode and influence.
Differential Revision: https://developer.blender.org/D3927
Diffstat (limited to 'source/blender/blenkernel/nla_private.h')
-rw-r--r-- | source/blender/blenkernel/nla_private.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/blenkernel/nla_private.h b/source/blender/blenkernel/nla_private.h index 67728445f3a..0ab48b5ef2c 100644 --- a/source/blender/blenkernel/nla_private.h +++ b/source/blender/blenkernel/nla_private.h @@ -79,6 +79,21 @@ typedef struct NlaEvalChannel { float value; /* value of this channel */ } NlaEvalChannel; +/* Information about the currently edited strip and ones below it for keyframing. */ +typedef struct NlaKeyframingContext { + struct NlaKeyframingContext *next, *prev; + + /* AnimData for which this context was built. */ + struct AnimData *adt; + + /* Data of the currently edited strip (copy, or fake strip for the main action). */ + NlaStrip strip; + NlaEvalStrip *eval_strip; + + /* Evaluated NLA stack below the current strip. */ + ListBase nla_channels; +} NlaKeyframingContext; + /* --------------- NLA Functions (not to be used as a proper API) ----------------------- */ /* convert from strip time <-> global time */ |