[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43596] trunk/blender/source/blender/ blenkernel/intern/nla.c: Bugfix [#28468] Cannot enter "Tweak mode" on mutiple objects at the same time,

Joshua Leung aligorith at gmail.com
Sun Jan 22 05:30:53 CET 2012


Revision: 43596
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43596
Author:   aligorith
Date:     2012-01-22 04:30:52 +0000 (Sun, 22 Jan 2012)
Log Message:
-----------
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 ;)

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/nla.c

Modified: trunk/blender/source/blender/blenkernel/intern/nla.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/nla.c	2012-01-22 04:30:11 UTC (rev 43595)
+++ trunk/blender/source/blender/blenkernel/intern/nla.c	2012-01-22 04:30:52 UTC (rev 43596)
@@ -1542,6 +1542,34 @@
 			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");



More information about the Bf-blender-cvs mailing list