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:
authorAlexander Gavrilov <angavrilov@gmail.com>2019-01-12 14:10:09 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-01-12 14:10:33 +0300
commit2826c2be545ee0382ef37da0b0b919757b75f10a (patch)
tree6b165eafca706c388e0143b223937b4793229250 /source/blender/blenkernel/intern/anim_sys.c
parent5e356cc5c89b96a1d66764501116487f1966e8e4 (diff)
NLA: ignore time range when evaluating a raw action.
When editing an action without a strip, or tweaking a strip without time mapping enabled or supported, the extents of the virtual strip can't be controlled and are purely derived from keys in the action. Thus, cutting off evaluation of the action at these arbitrary points gets in the way of observing the natural extrapolation of the F-Curves and thus appears to be a mis-feature. With this change non-mapped actions are evaluated with infinite range, exactly like they are handled without NLA, unless extend mode is set to Nothing.
Diffstat (limited to 'source/blender/blenkernel/intern/anim_sys.c')
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index c5a21342dc0..5ec3b931f09 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -1888,11 +1888,18 @@ static void nlastrip_evaluate_controls(Depsgraph *depsgraph, NlaStrip *strip, fl
* - we do this after the F-Curves have been evaluated to override the effects of those
* in case the override has been turned off.
*/
- if ((strip->flag & NLASTRIP_FLAG_USR_TIME) == 0)
- strip->strip_time = nlastrip_get_frame(strip, ctime, NLATIME_CONVERT_EVAL);
if ((strip->flag & NLASTRIP_FLAG_USR_INFLUENCE) == 0)
strip->influence = nlastrip_get_influence(strip, ctime);
+ /* Bypass evaluation time computation if time mapping is disabled. */
+ if ((strip->flag & NLASTRIP_FLAG_NO_TIME_MAP) != 0) {
+ strip->strip_time = ctime;
+ return;
+ }
+
+ if ((strip->flag & NLASTRIP_FLAG_USR_TIME) == 0)
+ strip->strip_time = nlastrip_get_frame(strip, ctime, NLATIME_CONVERT_EVAL);
+
/* if user can control the evaluation time (using F-Curves), consider the option which allows this time to be clamped
* to lie within extents of the action-clip, so that a steady changing rate of progress through several cycles of the clip
* can be achieved easily
@@ -1912,7 +1919,7 @@ NlaEvalStrip *nlastrips_ctime_get_strip(Depsgraph *depsgraph, ListBase *list, Li
/* loop over strips, checking if they fall within the range */
for (strip = strips->first; strip; strip = strip->next) {
/* check if current time occurs within this strip */
- if (IN_RANGE_INCL(ctime, strip->start, strip->end)) {
+ if (IN_RANGE_INCL(ctime, strip->start, strip->end) || (strip->flag & NLASTRIP_FLAG_NO_TIME_MAP)) {
/* this strip is active, so try to use it */
estrip = strip;
side = NES_TIME_WITHIN;
@@ -2971,13 +2978,18 @@ static bool animsys_evaluate_nla(Depsgraph *depsgraph, NlaEvalData *echannels, P
/* Always use the blend mode of the strip in tweak mode, even if not in-place. */
if (nlt && adt->actstrip) {
dummy_strip->blendmode = adt->actstrip->blendmode;
- dummy_strip->extendmode = adt->actstrip->extendmode;
+ dummy_strip->extendmode = NLASTRIP_EXTEND_HOLD;
}
else {
dummy_strip->blendmode = adt->act_blendmode;
dummy_strip->extendmode = adt->act_extendmode;
}
+ /* Unless extendmode is Nothing (might be useful for flattening NLA evaluation), disable range. */
+ if (dummy_strip->extendmode != NLASTRIP_EXTEND_NOTHING) {
+ dummy_strip->flag |= NLASTRIP_FLAG_NO_TIME_MAP;
+ }
+
dummy_strip->influence = adt->act_influence;
/* NOTE: must set this, or else the default setting overrides, and this setting doesn't work */