diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-08-02 17:15:20 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-08-02 17:15:20 +0400 |
commit | 81146e419cc9958559b3a4b0f1c919e378cce531 (patch) | |
tree | 40e1dbba948496b1484300b8c3b50da893a2d271 /source/blender/blenkernel/intern/nla.c | |
parent | 1aa3885ef72658771bec837007b3ef0296a81bc4 (diff) |
NLA Tweaks:
* "Pushing down" the action to make a new strip will now make the new strip the 'active' one.
* 'Active Action' field in Animation Data panel is now editable as long as we aren't in "tweakmode"
Diffstat (limited to 'source/blender/blenkernel/intern/nla.c')
-rw-r--r-- | source/blender/blenkernel/intern/nla.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 1871ec006f4..c41c4ae78e4 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -993,6 +993,28 @@ NlaStrip *BKE_nlastrip_find_active (NlaTrack *nlt) return NULL; } +/* Make the given NLA-Strip the active one within the given block */ +void BKE_nlastrip_set_active (AnimData *adt, NlaStrip *strip) +{ + NlaTrack *nlt; + NlaStrip *nls; + + /* sanity checks */ + if (adt == NULL) + return; + + /* loop over tracks, deactivating*/ + for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) { + for (nls= nlt->strips.first; nls; nls= nls->next) { + if (nls != strip) + nls->flag &= ~NLASTRIP_FLAG_ACTIVE; + else + nls->flag |= NLASTRIP_FLAG_ACTIVE; + } + } +} + + /* Does the given NLA-strip fall within the given bounds (times)? */ short BKE_nlastrip_within_bounds (NlaStrip *strip, float min, float max) { @@ -1403,6 +1425,9 @@ void BKE_nla_action_pushdown (AnimData *adt) // FIXME: this needs to be more automated, since user can rearrange strips strip->extendmode= NLASTRIP_EXTEND_HOLD_FORWARD; } + + /* make strip the active one... */ + BKE_nlastrip_set_active(adt, strip); } } |