diff options
author | Joshua Leung <aligorith@gmail.com> | 2015-04-12 11:42:34 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2015-04-14 09:39:02 +0300 |
commit | 097801e701cec7ae1e388d201ca3426153616097 (patch) | |
tree | 06de60ef28519ff84cbf622a7602bb69ebf63596 /source/blender/blenkernel/intern/nla.c | |
parent | d841b75c5f1e6de60bc57804204b73f2c3de4530 (diff) |
NLA: Shift-Tab toggles tweakmode AND makes that track solo
To help make it more convenient to edit stashed actions, Shift-Tab
(i.e. holding down the Shift key, which "tabbing" into tweakmode as
usual to edit the action referenced by the active NLA strip) now flags
the NLA Track that the strip occupies as being "solo" too.
This allows you to use the NLA to select a stashed action, then Shift-Tab
to start editing it without any other actions in the NLA stack interfering.
Like the "Next/Previous Layer" tools in the Action Editor, this is designed
to help with checking on stashed actions.
Diffstat (limited to 'source/blender/blenkernel/intern/nla.c')
-rw-r--r-- | source/blender/blenkernel/intern/nla.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index c87f378d5ae..eaa4460ce70 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -926,6 +926,40 @@ NlaTrack *BKE_nlatrack_find_active(ListBase *tracks) return NULL; } +/* Get the NLA Track that the active action/action strip comes from, + * since this info is not stored in AnimData. It also isn't as simple + * 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; + + /* sanity check */ + if (adt == NULL) + return NULL; + + /* Since the track itself gets disabled, we want the first disabled... */ + for (nlt = adt->nla_tracks.first; nlt; nlt = nlt->next) { + if (nlt->flag & (NLATRACK_ACTIVE | NLATRACK_DISABLED)) { + /* For good measure, make sure that strip actually exists there */ + if (BLI_findindex(&nlt->strips, adt->actstrip) != -1) { + return nlt; + } + else if (G.debug & G_DEBUG) { + printf("%s: Active strip (%p, %s) not in NLA track found (%p, %s)\n", + __func__, + adt->actstrip, (adt->actstrip) ? adt->actstrip->name : "<None>", + nlt, nlt->name); + } + } + } + + /* Not found! */ + return NULL; +} + /* Toggle the 'solo' setting for the given NLA-track, making sure that it is the only one * that has this status in its AnimData block. */ |