Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2015-04-14 08:10:04 +0300
committerJoshua Leung <aligorith@gmail.com>2015-04-14 09:39:07 +0300
commitbb1bc7ecda28cc3c70992f8383151e4055a227e0 (patch)
treeffc7f7b729a997037994fcf234d0b898098ef72c /source/blender/blenkernel/intern
parentc95f38b92aa2981a771c4a4c010270547becec26 (diff)
NLA: Store track that the strip being tweaked comes from
There should be no functional changes visible from this change, but this commit should make it easier to code tools which need to check on tweeakmode status, by making it easier to figure out which NLA Track contains the strip which owned the action being edited. (The strip is already saved, so this commit just adds the track alongside it). For now there is no version patch for this. The worst that happens is that an extra refresh is needed in the NLA editor to get these to show up.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/nla.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index eaa4460ce70..650efea2e96 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -535,9 +535,14 @@ float BKE_nla_tweakedit_remap(AnimData *adt, float cframe, short mode)
/* if the active-strip info has been stored already, access this, otherwise look this up
* and store for (very probable) future usage
*/
+ if (adt->act_track == NULL) {
+ if (adt->actstrip)
+ adt->act_track = BKE_nlatrack_find_tweaked(adt);
+ else
+ adt->act_track = BKE_nlatrack_find_active(&adt->nla_tracks);
+ }
if (adt->actstrip == NULL) {
- NlaTrack *nlt = BKE_nlatrack_find_active(&adt->nla_tracks);
- adt->actstrip = BKE_nlastrip_find_active(nlt);
+ adt->actstrip = BKE_nlastrip_find_active(adt->act_track);
}
strip = adt->actstrip;
@@ -931,7 +936,6 @@ NlaTrack *BKE_nlatrack_find_active(ListBase *tracks)
* as just using the active track, since multiple tracks may have been
* entered at the same time.
*/
-// TODO: Store this info in AnimData... Old files would still need to use this function for version patching though
NlaTrack *BKE_nlatrack_find_tweaked(AnimData *adt)
{
NlaTrack *nlt;
@@ -1796,6 +1800,7 @@ bool BKE_nla_tweakmode_enter(AnimData *adt)
*/
adt->tmpact = adt->action;
adt->action = activeStrip->act;
+ adt->act_track = activeTrack;
adt->actstrip = activeStrip;
id_us_plus(&activeStrip->act->id);
adt->flag |= ADT_NLA_EDIT_ON;
@@ -1855,6 +1860,7 @@ void BKE_nla_tweakmode_exit(AnimData *adt)
if (adt->action) adt->action->id.us--;
adt->action = adt->tmpact;
adt->tmpact = NULL;
+ adt->act_track = NULL;
adt->actstrip = NULL;
adt->flag &= ~ADT_NLA_EDIT_ON;
}