diff options
author | Joshua Leung <aligorith@gmail.com> | 2015-04-03 14:13:42 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2015-04-03 15:39:56 +0300 |
commit | 943b830bf6b0b992323e9d439bdf7ed758212846 (patch) | |
tree | 5b6f89d7ae0bb102df5fcd84c2af156081ca79da /source | |
parent | 961dac55cfc74f778ac0868e39707daea3098ef6 (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_action/action_data.c | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/source/blender/editors/space_action/action_data.c b/source/blender/editors/space_action/action_data.c index 52c8729fc8a..e141789d7a9 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 |