[Bf-blender-cvs] [89ee260ef22] master: Fix T63675: Keying outside NLA strip not possible

Wayde Moss noreply at git.blender.org
Thu Aug 20 17:24:58 CEST 2020


Commit: 89ee260ef22e27c9064dad54331c4c595f23b7e5
Author: Wayde Moss
Date:   Thu Aug 20 16:52:08 2020 +0200
Branches: master
https://developer.blender.org/rB89ee260ef22e27c9064dad54331c4c595f23b7e5

Fix T63675: Keying outside NLA strip not possible

Allow adding keys outside of the NLA strip, when Sync Length is
activated. Before this, an animator would have to exit tweak mode,
adjust the strip length, then enter tweak mode again.

Now the animator can freely insert and modify keys outside of the strip
bounds. They will never have to touch the strip bounds directly.

Reviewed By: sybren

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

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

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

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

diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 5b5e32f1d81..8fe57f1bfa0 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -2192,7 +2192,15 @@ static bool animsys_evaluate_nla(NlaEvalData *echannels,
       if (is_inplace_tweak) {
         /* edit active action in-place according to its active strip, so copy the data  */
         memcpy(dummy_strip, adt->actstrip, sizeof(NlaStrip));
+        /* Prevents nla eval from considering active strip's adj strips.
+         * For user, this means entering tweak mode on a strip ignores evaluating adjacent strips
+         * in the same track. */
         dummy_strip->next = dummy_strip->prev = NULL;
+
+        /* If tweaked strip is syncing action length, then evaluate using action length. */
+        if (dummy_strip->flag & NLASTRIP_FLAG_SYNC_LENGTH) {
+          BKE_nlastrip_recalculate_bounds_sync_action(dummy_strip);
+        }
       }
       else {
         /* set settings of dummy NLA strip from AnimData settings */
@@ -2237,9 +2245,11 @@ static bool animsys_evaluate_nla(NlaEvalData *echannels,
       /* If computing the context for keyframing, store data there instead of the list. */
       else {
         /* The extend mode here effectively controls
-         * whether it is possible to key-frame beyond the ends. */
-        dummy_strip->extendmode = is_inplace_tweak ? NLASTRIP_EXTEND_NOTHING :
-                                                     NLASTRIP_EXTEND_HOLD;
+         * whether it is possible to key-frame beyond the ends.*/
+        dummy_strip->extendmode = (is_inplace_tweak &&
+                                   !(dummy_strip->flag & NLASTRIP_FLAG_SYNC_LENGTH)) ?
+                                      NLASTRIP_EXTEND_NOTHING :
+                                      NLASTRIP_EXTEND_HOLD;
 
         r_context->eval_strip = nes = nlastrips_ctime_get_strip(
             NULL, &dummy_trackslist, -1, anim_eval_context, flush_to_original);



More information about the Bf-blender-cvs mailing list