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>2009-08-02 17:15:20 +0400
committerJoshua Leung <aligorith@gmail.com>2009-08-02 17:15:20 +0400
commit81146e419cc9958559b3a4b0f1c919e378cce531 (patch)
tree40e1dbba948496b1484300b8c3b50da893a2d271 /source/blender/blenkernel
parent1aa3885ef72658771bec837007b3ef0296a81bc4 (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')
-rw-r--r--source/blender/blenkernel/BKE_nla.h1
-rw-r--r--source/blender/blenkernel/intern/nla.c25
2 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h
index 241a8fd7b59..989043c1d67 100644
--- a/source/blender/blenkernel/BKE_nla.h
+++ b/source/blender/blenkernel/BKE_nla.h
@@ -80,6 +80,7 @@ short BKE_nlatrack_add_strip(struct NlaTrack *nlt, struct NlaStrip *strip);
/* ............ */
struct NlaStrip *BKE_nlastrip_find_active(struct NlaTrack *nlt);
+void BKE_nlastrip_set_active(struct AnimData *adt, struct NlaStrip *strip);
short BKE_nlastrip_within_bounds(struct NlaStrip *strip, float min, float max);
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);
}
}