diff options
-rw-r--r-- | source/blender/blenkernel/intern/anim_sys.c | 20 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_anim_types.h | 2 |
2 files changed, 18 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 */ diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index 8e89f4a42b7..15203812b2d 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -763,6 +763,8 @@ typedef enum eNlaStrip_Flag { NLASTRIP_FLAG_MIRROR = (1<<13), /* temporary editing flags */ + /* NLA strip should ignore frame range and hold settings, and evaluate at global time. */ + NLASTRIP_FLAG_NO_TIME_MAP = (1<<29), /* NLA-Strip is really just a temporary meta used to facilitate easier transform code */ NLASTRIP_FLAG_TEMP_META = (1<<30), NLASTRIP_FLAG_EDIT_TOUCHED = (1u << 31) |