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>2012-01-22 08:30:52 +0400
committerJoshua Leung <aligorith@gmail.com>2012-01-22 08:30:52 +0400
commit7d13619990dc1fff12a32bee11a9856688948bf4 (patch)
tree94f440d6c6cfd86ce4dc8cc7a1f9f27361500e9c /source/blender/blenkernel/intern/nla.c
parentaf9ac97b2ed1a678ff59e221152a712140e2bd08 (diff)
Bugfix [#28468] Cannot enter "Tweak mode" on mutiple objects at the same time,
though it initially works Problem was that in the past it was possible to have multiple strips/tracks tagged as "active", but now after getting a correct implementation, we can no longer have that, and thus entering Tweak Mode only works on the last selected strip. However this is problematic in cases when you want to tweak the keyframes of several objects (which may only have a single strip each) in order to get them to line up with each other. This hack caters for this case (selecting multiple strips from the same AnimData block is still impossible and insane/illogical and is not allowed). This may have implications for some future tools which make assumptions about certain aspects of NLA state. However, it shouldn't cause too many problems (hopefully ;)
Diffstat (limited to 'source/blender/blenkernel/intern/nla.c')
-rw-r--r--source/blender/blenkernel/intern/nla.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index fd184b9def4..147f39b6728 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -1542,6 +1542,34 @@ short BKE_nla_tweakmode_enter (AnimData *adt)
break;
}
}
+
+ /* There are situations where we may have multiple strips selected and we want to enter tweakmode on all
+ * of those at once. Usually in those cases, it will usually just be a single strip per AnimData.
+ * In such cases, compromise and take the last selected track and/or last selected strip [#28468]
+ */
+ if (activeTrack == NULL) {
+ /* try last selected track for active strip */
+ for (nlt = adt->nla_tracks.last; nlt; nlt = nlt->prev) {
+ if (nlt->flag & NLATRACK_SELECTED) {
+ /* assume this is the active track */
+ activeTrack= nlt;
+
+ /* try to find active strip */
+ activeStrip= BKE_nlastrip_find_active(nlt);
+ break;
+ }
+ }
+ }
+ if ((activeTrack) && (activeStrip == NULL)) {
+ /* no active strip in active or last selected track; compromise for first selected (assuming only single)... */
+ for (strip = activeTrack->strips.first; strip; strip= strip->next) {
+ if (strip->flag & (NLASTRIP_FLAG_SELECT|NLASTRIP_FLAG_ACTIVE)) {
+ activeStrip = strip;
+ break;
+ }
+ }
+ }
+
if ELEM3(NULL, activeTrack, activeStrip, activeStrip->act) {
if (G.f & G_DEBUG) {
printf("NLA tweakmode enter - neither active requirement found \n");