[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21404] branches/soc-2009-aligorith/source /blender: NLA SoC: Fixed bug with NLA-Transform
Joshua Leung
aligorith at gmail.com
Tue Jul 7 12:25:55 CEST 2009
Revision: 21404
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21404
Author: aligorith
Date: 2009-07-07 12:25:55 +0200 (Tue, 07 Jul 2009)
Log Message:
-----------
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.
Modified Paths:
--------------
branches/soc-2009-aligorith/source/blender/blenkernel/intern/nla.c
branches/soc-2009-aligorith/source/blender/editors/transform/transform_conversions.c
Modified: branches/soc-2009-aligorith/source/blender/blenkernel/intern/nla.c
===================================================================
--- branches/soc-2009-aligorith/source/blender/blenkernel/intern/nla.c 2009-07-07 08:44:21 UTC (rev 21403)
+++ branches/soc-2009-aligorith/source/blender/blenkernel/intern/nla.c 2009-07-07 10:25:55 UTC (rev 21404)
@@ -546,26 +546,28 @@
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;
Modified: branches/soc-2009-aligorith/source/blender/editors/transform/transform_conversions.c
===================================================================
--- branches/soc-2009-aligorith/source/blender/editors/transform/transform_conversions.c 2009-07-07 08:44:21 UTC (rev 21403)
+++ branches/soc-2009-aligorith/source/blender/editors/transform/transform_conversions.c 2009-07-07 10:25:55 UTC (rev 21404)
@@ -4836,8 +4836,7 @@
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);
More information about the Bf-blender-cvs
mailing list