diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2022-04-29 17:17:58 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2022-04-29 17:28:02 +0300 |
commit | 2f49908a5e57a3476e5abf19267988775072c76d (patch) | |
tree | 55652293fc6fa9c582b6d12376c01d226eb709f8 /source | |
parent | baae87ce86dc502e2ac28ffb241deba891cdcec1 (diff) |
NLA: Key influence when pushing down to NLA
When pushing down an Action onto an NLA track, set the new Strip's
influence to the Action's influence. This is done by setting a key due
to the way the NLA Strip influence works (it's either animated, or
ignored).
Reviewed By: sybren, RiggingDojo
Differential Revision: https://developer.blender.org/D14719
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/nla.c | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 9b6d768b2d3..5d804f53779 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -1818,7 +1818,6 @@ bool BKE_nla_action_stash(AnimData *adt, const bool is_liboverride) void BKE_nla_action_pushdown(AnimData *adt, const bool is_liboverride) { NlaStrip *strip; - const bool is_first = (adt) && (adt->nla_tracks.first == NULL); /* sanity checks */ /* TODO: need to report the error for this */ @@ -1848,27 +1847,23 @@ void BKE_nla_action_pushdown(AnimData *adt, const bool is_liboverride) /* copy current "action blending" settings from adt to the strip, * as it was keyframed with these settings, so omitting them will * change the effect [T54233] - * - * NOTE: We only do this when there are no tracks */ - if (is_first == false) { - strip->blendmode = adt->act_blendmode; - strip->influence = adt->act_influence; - strip->extendmode = adt->act_extendmode; - - if (adt->act_influence < 1.0f) { - /* enable "user-controlled" influence (which will insert a default keyframe) - * so that the influence doesn't get lost on the new update - * - * NOTE: An alternative way would have been to instead hack the influence - * to not get always get reset to full strength if NLASTRIP_FLAG_USR_INFLUENCE - * is disabled but auto-blending isn't being used. However, that approach - * is a bit hacky/hard to discover, and may cause backwards compatibility issues, - * so it's better to just do it this way. - */ - strip->flag |= NLASTRIP_FLAG_USR_INFLUENCE; - BKE_nlastrip_validate_fcurves(strip); - } + strip->blendmode = adt->act_blendmode; + strip->influence = adt->act_influence; + strip->extendmode = adt->act_extendmode; + + if (adt->act_influence < 1.0f) { + /* enable "user-controlled" influence (which will insert a default keyframe) + * so that the influence doesn't get lost on the new update + * + * NOTE: An alternative way would have been to instead hack the influence + * to not get always get reset to full strength if NLASTRIP_FLAG_USR_INFLUENCE + * is disabled but auto-blending isn't being used. However, that approach + * is a bit hacky/hard to discover, and may cause backwards compatibility issues, + * so it's better to just do it this way. + */ + strip->flag |= NLASTRIP_FLAG_USR_INFLUENCE; + BKE_nlastrip_validate_fcurves(strip); } /* make strip the active one... */ |