diff options
author | Joshua Leung <aligorith@gmail.com> | 2014-05-03 14:08:35 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2014-05-04 08:35:12 +0400 |
commit | 91f90f61d39f261b9984d3305566f53fc06984dd (patch) | |
tree | 1151715793a6cfeca602c7358d2c432802e8e55d | |
parent | fd80ac4c3e8429e52dcdde8fe20dd16ae329922d (diff) |
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)
-rw-r--r-- | source/blender/blenkernel/intern/anim_sys.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index ae4580bfdfe..00faa1cb5bf 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; } } |