forked from bartvdbraak/blender
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)
This commit is contained in:
parent
fd80ac4c3e
commit
91f90f61d3
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user