[Bf-blender-cvs] [943b830] master: Action Layer Up/Down: Fixes for NLA Solo / NLA Muting

Joshua Leung noreply at git.blender.org
Fri Apr 3 14:41:21 CEST 2015


Commit: 943b830bf6b0b992323e9d439bdf7ed758212846
Author: Joshua Leung
Date:   Sat Apr 4 00:13:42 2015 +1300
Branches: master
https://developer.blender.org/rB943b830bf6b0b992323e9d439bdf7ed758212846

Action Layer Up/Down: Fixes for NLA Solo / NLA Muting

Now marking NLA Tracks as Solo'd and muting the NLA stack are linked together
when using the Action Layer Up/Down tools. That is, when switching from a NLA strip
to the active action, if the track was solo'd, then the NLA stack will get muted;
and when switching from the active action to a NLA track, if the stack was muted,
the track will get solo'd. This linkage means that we ensure that when moving up
and down the stack, we can continue to check the actions in isolation without things
messing up when you switch to and from the active action.

Also fixed a bug where this wasn't getting applied when going in the other direction.

TODO:
- When we get the rest/reference track support, we're going to need to insert
  some calls to flush the restpose values so that values from the previously
  used action do not pollute the pose for the new action (if not all the
  same controls get keyed across both). For now, it's best to only do this
  switching from the first frame.

===================================================================

M	source/blender/editors/space_action/action_data.c

===================================================================

diff --git a/source/blender/editors/space_action/action_data.c b/source/blender/editors/space_action/action_data.c
index 52c8729..e141789 100644
--- a/source/blender/editors/space_action/action_data.c
+++ b/source/blender/editors/space_action/action_data.c
@@ -595,6 +595,19 @@ static void action_layer_switch_strip(AnimData *adt,
 			nlt->flag |= NLATRACK_SOLO;
 		}
 	}
+	else {
+		/* NLA muting <==> Solo Tracks */
+		if (adt->flag & ADT_NLA_EVAL_OFF) {
+			/* disable NLA muting */
+			adt->flag &= ~ADT_NLA_EVAL_OFF;
+			
+			/* mark this track as being solo */
+			adt->flag |= ADT_NLA_SOLO_TRACK;
+			nlt->flag |= NLATRACK_SOLO;
+			
+			// TODO: Needs restpose flushing (when we get reference track)
+		}
+	}
 	
 	/* Enter tweakmode again - hopefully we're now "it" */
 	BKE_nla_tweakmode_enter(adt);
@@ -670,15 +683,24 @@ static int action_layer_next_exec(bContext *C, wmOperator *op)
 		}
 	}
 	else {
-		/* No more actions - Go back to editing the original active action
+		/* No more actions (strips) - Go back to editing the original active action
 		 * NOTE: This will mean exiting tweakmode...
 		 */
 		BKE_nla_tweakmode_exit(adt);
 		
-		/* Deal with solo flags... */
-		// XXX: if solo, turn off NLA while we edit this action?
-		act_track->flag &= ~NLATRACK_SOLO;
-		adt->flag &= ~ADT_NLA_SOLO_TRACK;
+		/* Deal with solo flags...
+		 * Assume: Solo Track == NLA Muting
+		 */
+		if (adt->flag & ADT_NLA_SOLO_TRACK) {
+			/* turn off solo flags on tracks */
+			act_track->flag &= ~NLATRACK_SOLO;
+			adt->flag &= ~ADT_NLA_SOLO_TRACK;
+			
+			/* turn on NLA muting (to keep same effect) */
+			adt->flag |= ADT_NLA_EVAL_OFF;
+			
+			// TODO: Needs restpose flushing (when we get reference track)
+		}
 	}
 	
 	/* Update the action that this editor now uses




More information about the Bf-blender-cvs mailing list