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:
-rw-r--r--source/blender/blenkernel/intern/nla.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 910de5c6763..5996bdc9f9a 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -916,9 +916,14 @@ void BKE_nlatrack_set_active (ListBase *tracks, NlaTrack *nlt_a)
/* Check if there is any space in the given track to add a strip of the given length */
short BKE_nlatrack_has_space (NlaTrack *nlt, float start, float end)
{
- /* sanity checks */
- if ((nlt == NULL) || IS_EQ(start, end))
+ /* sanity checks
+ * - track must exist
+ * - track must be editable
+ * - bounds cannot be equal (0-length is nasty)
+ */
+ if ((nlt == NULL) || (nlt->flag & NLATRACK_PROTECTED) || IS_EQ(start, end))
return 0;
+
if (start > end) {
puts("BKE_nlatrack_has_space() error... start and end arguments swapped");
SWAP(float, start, end);