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-07-07 14:25:55 +0400
committerJoshua Leung <aligorith@gmail.com>2009-07-07 14:25:55 +0400
commite22fefc2c8ef2c844d32d9aed23a04013cc364fb (patch)
tree336330cba67059ba2ec3711b7628f5999813afe9 /source/blender/blenkernel
parenta86d20e5a26700beac595bd8aaccb646be0f802c (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/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/nla.c12
1 files changed, 7 insertions, 5 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;