Fix #100718: NLA Hold Forward Inconsistency #107281

Closed
Wayde Moss wants to merge 2 commits from wbmoss_dev/blender:pr_fix_100718_NLA_Hold_Forward_Inconsistency into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 15 additions and 2 deletions
Showing only changes of commit 6716fbed37 - Show all commits

View File

@ -989,8 +989,21 @@ NlaEvalStrip *nlastrips_ctime_get_strip(ListBase *list,
/* 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) ||
(strip->flag & NLASTRIP_FLAG_NO_TIME_MAP)) {
/* This block leads to the Action Track and non-time-remapped tweak strip evaluation to respect
* the extrapolation modes. If in_range, these two tracks will always output NES_TIME_WITHIN so
* fcurve extrapolation isn't clamped to the keyframe bounds. */
bool in_range = IN_RANGE_INCL(ctime, strip->start, strip->end);
if (strip->flag & NLASTRIP_FLAG_NO_TIME_MAP) {
if (ELEM(strip->extendmode, NLASTRIP_EXTEND_HOLD)) {

Can't this just be coded like this? I don't see the need for ELEM() here.

switch (strip->extendmode) {
  case NLASTRIP_EXTEND_HOLD: in_range = true; break;
  case NLASTRIP_EXTEND_HOLD_FORWARD: in_range = ctime >= strip->start; break;
}
Can't this just be coded like this? I don't see the need for `ELEM()` here. ```c switch (strip->extendmode) { case NLASTRIP_EXTEND_HOLD: in_range = true; break; case NLASTRIP_EXTEND_HOLD_FORWARD: in_range = ctime >= strip->start; break; } ```
in_range = true;
}
else if (ELEM(strip->extendmode, NLASTRIP_EXTEND_HOLD_FORWARD)) {
in_range = ctime >= strip->start;
}
}
if (in_range) {
/* this strip is active, so try to use it */
estrip = strip;
side = NES_TIME_WITHIN;