[Bf-blender-cvs] [164e117abab] tmp-T82230-nla_remove_hold_reset_behavior: NLA: Remove Hold resetting between Hold_Forward Behavior

Wayde Moss noreply at git.blender.org
Wed Dec 30 20:33:10 CET 2020


Commit: 164e117abab8e534194d8214710979da35d0698a
Author: Wayde Moss
Date:   Wed Dec 30 14:28:49 2020 -0500
Branches: tmp-T82230-nla_remove_hold_reset_behavior
https://developer.blender.org/rB164e117abab8e534194d8214710979da35d0698a

NLA: Remove Hold resetting between Hold_Forward Behavior

Before, moving (or Push-Down Action-ing) a Replace strip with extrap=`Hold or Hold_Forward` will auto reset to the other based on whichever first occurs among all the tracks. Now, that auto reset behavior has been completely removed and //only// that behavior.

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.

Part of {T82230}

Differential Revision: https://developer.blender.org/D9942

===================================================================

M	source/blender/blenkernel/intern/nla.c

===================================================================

diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 75230f9045c..f734ffd677e 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -1790,7 +1790,7 @@ static void BKE_nlastrip_validate_autoblends(NlaTrack *nlt, NlaStrip *nls)
 /* Ensure that auto-blending and other settings are set correctly */
 void BKE_nla_validate_state(AnimData *adt)
 {
-  NlaStrip *strip, *fstrip = NULL;
+  NlaStrip *strip = NULL;
   NlaTrack *nlt;
 
   /* sanity checks */
@@ -1804,37 +1804,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;
-        }
-      }
     }
   }
 }
@@ -2001,20 +1970,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);
 }



More information about the Bf-blender-cvs mailing list