[Bf-blender-cvs] [91f90f6] master: NLA Eval Bugfix: Influence settings on active action didn't work

Joshua Leung noreply at git.blender.org
Sun May 4 14:24:02 CEST 2014


Commit: 91f90f61d39f261b9984d3305566f53fc06984dd
Author: Joshua Leung
Date:   Sat May 3 22:08:35 2014 +1200
https://developer.blender.org/rB91f90f61d39f261b9984d3305566f53fc06984dd

NLA Eval Bugfix: Influence settings on active action didn't work

* The automatically calculated influence was overriding the value we were passing
  into the dummy strip, making this seem like it doesn't work

* Made some tweaks to prevent some potential memory-related bugs
   - nlastrips_ctime_get_strip() actually saves off references to the list of strips
     it gets, so declaring dummy_strip in an inner scope like this could potentially
     be quite dangerous
   - Prevented a potential memory leak for the early abort when there are no strips
     for whatever reason (it shouldn't occur though)

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

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 ae4580b..00faa1c 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -2249,6 +2249,9 @@ static void animsys_evaluate_nla(ListBase *echannels, PointerRNA *ptr, AnimData
 	ListBase estrips = {NULL, NULL};
 	NlaEvalStrip *nes;
 	
+	NlaStrip dummy_strip = {NULL}; /* dummy strip for active action */
+	
+	
 	/* 1. get the stack of strips to evaluate at current time (influence calculated here) */
 	for (nlt = adt->nla_tracks.first; nlt; nlt = nlt->next, track_index++) {
 		/* stop here if tweaking is on and this strip is the tweaking track (it will be the first one that's 'disabled')... */
@@ -2282,7 +2285,6 @@ static void animsys_evaluate_nla(ListBase *echannels, PointerRNA *ptr, AnimData
 		/* if there are strips, evaluate action as per NLA rules */
 		if ((has_strips) || (adt->actstrip)) {
 			/* make dummy NLA strip, and add that to the stack */
-			NlaStrip dummy_strip = {NULL};
 			ListBase dummy_trackslist;
 			
 			dummy_trackslist.first = dummy_trackslist.last = &dummy_strip;
@@ -2305,6 +2307,9 @@ static void animsys_evaluate_nla(ListBase *echannels, PointerRNA *ptr, AnimData
 				dummy_strip.blendmode = adt->act_blendmode;
 				dummy_strip.extendmode = adt->act_extendmode;
 				dummy_strip.influence = adt->act_influence;
+				
+				/* NOTE: must set this, or else the default setting overrides, and this setting doesn't work */
+				dummy_strip.flag |= NLASTRIP_FLAG_USR_INFLUENCE;
 			}
 			
 			/* add this to our list of evaluation strips */
@@ -2313,7 +2318,10 @@ static void animsys_evaluate_nla(ListBase *echannels, PointerRNA *ptr, AnimData
 		else {
 			/* special case - evaluate as if there isn't any NLA data */
 			/* TODO: this is really just a stop-gap measure... */
+			if (G.debug & G_DEBUG) printf("NLA Eval: Stopgap for active action on NLA Stack - no strips case\n");
+			
 			animsys_evaluate_action(ptr, adt->action, adt->remap, ctime);
+			BLI_freelistN(&estrips);
 			return;
 		}
 	}




More information about the Bf-blender-cvs mailing list