[Bf-blender-cvs] [46ad5b6] master: Tweaks for NLA and newly added Action Stash Tracks
Joshua Leung
noreply at git.blender.org
Sat Feb 28 14:37:25 CET 2015
Commit: 46ad5b6f67cb53f7e7b7ca17118bc1f321c388d0
Author: Joshua Leung
Date: Sun Mar 1 01:48:38 2015 +1300
Branches: master
https://developer.blender.org/rB46ad5b6f67cb53f7e7b7ca17118bc1f321c388d0
Tweaks for NLA and newly added Action Stash Tracks
* Do not make Action Stash Tracks or their strips active/selected
* Lock the track to prevent accidental editing/adding of other strips
* Prevent strips from being added into locked tracks by the pushdown operator.
This is mainly to prevent pushdown actions from getting into the stash tracks.
===================================================================
M source/blender/blenkernel/intern/nla.c
===================================================================
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 4af1f4c..8e143e2 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -1020,6 +1020,10 @@ bool BKE_nlatrack_add_strip(NlaTrack *nlt, NlaStrip *strip)
if (ELEM(NULL, nlt, strip))
return false;
+ /* do not allow adding strips if this track is locked */
+ if (nlt->flag & NLATRACK_PROTECTED)
+ return false;
+
/* try to add the strip to the track using a more generic function */
return BKE_nlastrips_add_strip(&nlt->strips, strip);
}
@@ -1572,7 +1576,6 @@ bool BKE_nla_action_stash(AnimData *adt)
}
nlt = add_nlatrack(adt, prev_track);
- nlt->flag |= NLATRACK_MUTED; /* so that stash track doesn't disturb the stack animation */
BLI_strncpy(nlt->name, STASH_TRACK_NAME, sizeof(nlt->name));
BLI_uniquename(&adt->nla_tracks, nlt, STASH_TRACK_NAME, '.', offsetof(NlaTrack, name), sizeof(nlt->name));
@@ -1584,7 +1587,15 @@ bool BKE_nla_action_stash(AnimData *adt)
BKE_nlatrack_add_strip(nlt, strip);
BKE_nlastrip_validate_name(adt, strip);
- BKE_nlastrip_set_active(adt, strip);
+
+ /* mark the stash track and strip so that they doesn't disturb the stack animation,
+ * and are unlikely to draw attention to itself (or be accidentally bumped around)
+ *
+ * NOTE: this must be done *after* adding the strip to the track, or else
+ * the strip locking will prevent the strip from getting added
+ */
+ nlt->flag = (NLATRACK_MUTED | NLATRACK_PROTECTED);
+ strip->flag &= ~(NLASTRIP_FLAG_SELECT | NLASTRIP_FLAG_ACTIVE);
/* succeeded */
return true;
More information about the Bf-blender-cvs
mailing list