diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-07-07 14:25:55 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-07-07 14:25:55 +0400 |
commit | e22fefc2c8ef2c844d32d9aed23a04013cc364fb (patch) | |
tree | 336330cba67059ba2ec3711b7628f5999813afe9 /source | |
parent | a86d20e5a26700beac595bd8aaccb646be0f802c (diff) |
NLA SoC: Fixed bug with NLA-Transform
Strip-sorting code was buggy, as it was trying to access an invalid pointer, so the call to sort strips after transform was temporarily disabled in previous commits.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/nla.c | 12 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 3 |
2 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 851a0d7b549..4dce9aebe24 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -546,26 +546,28 @@ short BKE_nlastrips_has_space (ListBase *strips, float start, float end) void BKE_nlastrips_sort_strips (ListBase *strips) { ListBase tmp = {NULL, NULL}; - NlaStrip *strip, *sstrip; + NlaStrip *strip, *sstrip, *stripn; /* sanity checks */ if ELEM(NULL, strips, strips->first) return; - + /* we simply perform insertion sort on this list, since it is assumed that per track, * there are only likely to be at most 5-10 strips */ - for (strip= strips->first; strip; strip= strip->next) { + for (strip= strips->first; strip; strip= stripn) { short not_added = 1; + stripn= strip->next; + /* remove this strip from the list, and add it to the new list, searching from the end of * the list, assuming that the lists are in order */ BLI_remlink(strips, strip); - for (sstrip= tmp.last; not_added && sstrip; sstrip= sstrip->prev) { + for (sstrip= tmp.last; sstrip; sstrip= sstrip->prev) { /* check if add after */ - if (sstrip->end < strip->start) { + if (sstrip->end <= strip->start) { BLI_insertlinkafter(&tmp, sstrip, strip); not_added= 0; break; diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 53c8e08ee74..0d19eeb913e 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4836,8 +4836,7 @@ void special_aftertrans_update(TransInfo *t) NlaTrack *nlt= (NlaTrack *)ale->data; /* make sure strips are in order again */ - // FIXME: this is buggy - //BKE_nlatrack_sort_strips(nlt); + BKE_nlatrack_sort_strips(nlt); /* remove the temp metas */ BKE_nlastrips_clear_metas(&nlt->strips, 0, 1); |