Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2022-04-08 16:33:59 +0300
committerSybren A. Stüvel <sybren@blender.org>2022-04-08 16:36:56 +0300
commit63d2980efa2fb170b471e4905ec81cd1472e5268 (patch)
tree6c918563edf20f99ea4d76e8da584fea0184008d
parentf2455c793985030c6cbe63a24d913319fc2d8d74 (diff)
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
-rw-r--r--source/blender/blenkernel/intern/nla.c80
1 files changed, 1 insertions, 79 deletions
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index e2d22064a37..a94562a32ec 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -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);
}