NLA: Remove Hold resetting between Hold_Forward Behavior

Avoid Blender overwriting artist's choices. The automatic change from
"Hold" (i.e. bidirectional extrapolation) to "Hold Forward" (i.e. only
extrapolate forward in time) has been removed.

This patch does not change strip evaluation. Between two strips, the
first with `None` extrapolation and the next with `Hold`, neither strip
will evaluate, which matches previous behavior. A future patch can
change the evaluation behavior.

Reviewed By: RiggingDojo, sybren

Maniphest Tasks: T82230

Differential Revision: https://developer.blender.org/D14230
This commit is contained in:
Sybren A. Stüvel 2022-04-08 15:33:59 +02:00
parent f2455c7939
commit 63d2980efa
Notes: blender-bot 2023-02-14 02:58:19 +01:00
Referenced by issue #100241, NLA editor doesnt work on multi layers in 3.2.2
Referenced by issue #82230, NLA: Moving Strips Auto Changes Between Hold and Hold_Forward
1 changed files with 1 additions and 79 deletions

View File

@ -1387,39 +1387,6 @@ void BKE_nlastrip_recalculate_bounds(NlaStrip *strip)
nlastrip_fix_resize_overlaps(strip);
}
/* Is the given NLA-strip the first one to occur for the given AnimData block */
/* TODO: make this an api method if necessary, but need to add prefix first */
static bool nlastrip_is_first(AnimData *adt, NlaStrip *strip)
{
NlaTrack *nlt;
NlaStrip *ns;
/* sanity checks */
if (ELEM(NULL, adt, strip)) {
return false;
}
/* check if strip has any strips before it */
if (strip->prev) {
return false;
}
/* check other tracks to see if they have a strip that's earlier */
/* TODO: or should we check that the strip's track is also the first? */
for (nlt = adt->nla_tracks.first; nlt; nlt = nlt->next) {
/* only check the first strip, assuming that they're all in order */
ns = nlt->strips.first;
if (ns) {
if (ns->start < strip->start) {
return false;
}
}
}
/* should be first now */
return true;
}
/* Animated Strips ------------------------------------------- */
bool BKE_nlatrack_has_animated_strips(NlaTrack *nlt)
@ -1739,7 +1706,7 @@ static void BKE_nlastrip_validate_autoblends(NlaTrack *nlt, NlaStrip *nls)
void BKE_nla_validate_state(AnimData *adt)
{
NlaStrip *strip, *fstrip = NULL;
NlaStrip *strip = NULL;
NlaTrack *nlt;
/* sanity checks */
@ -1753,37 +1720,6 @@ void BKE_nla_validate_state(AnimData *adt)
for (strip = nlt->strips.first; strip; strip = strip->next) {
/* auto-blending first */
BKE_nlastrip_validate_autoblends(nlt, strip);
/* extend mode - find first strip */
if ((fstrip == NULL) || (strip->start < fstrip->start)) {
fstrip = strip;
}
}
}
/* second pass over the strips to adjust the extend-mode to fix any problems */
for (nlt = adt->nla_tracks.first; nlt; nlt = nlt->next) {
for (strip = nlt->strips.first; strip; strip = strip->next) {
/* apart from 'nothing' option which user has to explicitly choose, we don't really know if
* we should be overwriting the extend setting (but assume that's what the user wanted)
*/
/* TODO: 1 solution is to tie this in with auto-blending... */
if (strip->extendmode != NLASTRIP_EXTEND_NOTHING) {
/* 1) First strip must be set to extend hold, otherwise, stuff before acts dodgy
* 2) Only overwrite extend mode if *not* changing it will most probably result in
* occlusion problems, which will occur if...
* - blendmode = REPLACE
* - all channels the same (this is fiddly to test, so is currently assumed)
*
* Should fix problems such as T29869.
*/
if (strip == fstrip) {
strip->extendmode = NLASTRIP_EXTEND_HOLD;
}
else if (strip->blendmode == NLASTRIP_MODE_REPLACE) {
strip->extendmode = NLASTRIP_EXTEND_HOLD_FORWARD;
}
}
}
}
}
@ -1935,20 +1871,6 @@ void BKE_nla_action_pushdown(AnimData *adt, const bool is_liboverride)
}
}
/* if the strip is the first one in the track it lives in, check if there
* are strips in any other tracks that may be before this, and set the extend
* mode accordingly
*/
if (nlastrip_is_first(adt, strip) == 0) {
/* Not first, so extend mode can only be:
* NLASTRIP_EXTEND_HOLD_FORWARD not NLASTRIP_EXTEND_HOLD,
* so that it doesn't override strips in previous tracks. */
/* FIXME: this needs to be more automated, since user can rearrange strips */
if (strip->extendmode == NLASTRIP_EXTEND_HOLD) {
strip->extendmode = NLASTRIP_EXTEND_HOLD_FORWARD;
}
}
/* make strip the active one... */
BKE_nlastrip_set_active(adt, strip);
}