diff options
author | Wayde Moss <GuiltyGhost> | 2020-12-30 22:29:12 +0300 |
---|---|---|
committer | Wayde Moss <wbmoss_dev@yahoo.com> | 2020-12-30 22:30:02 +0300 |
commit | dc4f3080fde5803e358e51e44668417291c1a3f5 (patch) | |
tree | 02465eda9eee72d0a4163dcd90ad4f16d845a068 /source | |
parent | 164e117abab8e534194d8214710979da35d0698a (diff) |
NLA: Strip Evaluate Held Strips Even When Not First Striptmp-T82230-nla_remove_hold_reset_behavior
Changes NLA strip evaluation.
A visual example of the change (with current frame between both strips):
**Before**:
| First strip extrapolation | Next strip extrapolation | Evaluated Strip
| None | Hold | Neither
| Hold or Hold_Forward| Hold | First
**Now**:
| First strip extrapolation | Next strip extrapolation | Evaluated Strip
| None | Hold | Next
| Hold or Hold_Forward | Hold | First
There isn't a concrete use-case for this new behavior. It's more to avoid the case of [None | Hold | Neither] which appears buggy.
UI-wise, the case of `Hold`/`Hold_Forward` leading to a `Hold` will draw with a slightly darker extrapolation area overlay. Pre-extrapolation and post-extrapolation alpha is changed to the same value now too.
Part of {T82230}
This patch functionally depends on {D9942} to sanely test this patch.
Differential Revision: https://developer.blender.org/D9943
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/anim_sys.c | 18 | ||||
-rw-r--r-- | source/blender/editors/space_nla/nla_draw.c | 8 |
2 files changed, 17 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 20956d6eb18..cef82ade906 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -877,17 +877,19 @@ NlaEvalStrip *nlastrips_ctime_get_strip(ListBase *list, side = NES_TIME_BEFORE; } else { - /* before next strip - previous strip has ended, but next hasn't begun, - * so blending mode depends on whether strip is being held or not... - * - only occurs when no transition strip added, otherwise the transition would have - * been picked up above... - */ - strip = strip->prev; + /* Before current strip - previous strip has ended, but current hasn't begun. */ - if (strip->extendmode != NLASTRIP_EXTEND_NOTHING) { + /* Order of branch important to give previous strip extrapolation higher priority.*/ + if (strip->prev->extendmode != NLASTRIP_EXTEND_NOTHING) { + /* Previous strip extrapolates forward. */ + estrip = strip->prev; + side = NES_TIME_AFTER; + } + else if (strip->extendmode == NLASTRIP_EXTEND_HOLD) { + /* Let current strip extrapolates backward. */ estrip = strip; + side = NES_TIME_BEFORE; } - side = NES_TIME_AFTER; } break; } diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 6fe980cf657..0ff656f340a 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -463,11 +463,17 @@ static void nla_draw_strip(SpaceNla *snla, */ if (strip->prev == NULL) { /* set the drawing color to the color of the strip, but with very faint alpha */ - immUniformColor3fvAlpha(color, 0.15f); + immUniformColor3fvAlpha(color, 0.30f); /* draw the rect to the edge of the screen */ immRectf(shdr_pos, v2d->cur.xmin, yminc, strip->start, ymaxc); } + else { + immUniformColor3fvAlpha(color, 0.30f); + /* Draw the rect to the prev strip. This will overlap with previous strip's Hold_Forward + * which is OK. */ + immRectf(shdr_pos, strip->prev->end, yminc, strip->start, ymaxc); + } ATTR_FALLTHROUGH; /* this only draws after the strip */ |