fix for fcurve doubles not being removed when moving more then one selected points...
authorCampbell Barton <ideasman42@gmail.com>
Thu, 17 Jun 2010 19:33:27 +0000 (19:33 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 17 Jun 2010 19:33:27 +0000 (19:33 +0000)
The bug could be redone with 3 points, 2 selected dragged onto the unselected.

looping backwards fixes this.

source/blender/editors/transform/transform_conversions.c

index 499631ff7559116a07a17a027e078040660d268e..d8e56331e19cf2a1fc76c99b6aa139ca9629e522 100644 (file)
@@ -2896,7 +2896,7 @@ static void posttrans_fcurve_clean (FCurve *fcu)
         * (if any keyframes were found, or the whole curve wasn't affected) 
         */
        if ((len) && (len != fcu->totvert)) {
-               for (i = 0; i < fcu->totvert; i++) {
+               for (i= fcu->totvert-1; i >= 0; i--) {
                        BezTriple *bezt= &fcu->bezt[i];
                        
                        if (BEZSELECTED(bezt) == 0) {
@@ -2906,7 +2906,7 @@ static void posttrans_fcurve_clean (FCurve *fcu)
                                                delete_fcurve_key(fcu, i, 0);
                                                break;
                                        }
-                                       else if (bezt->vec[1][0] > selcache[index])
+                                       else if (bezt->vec[1][0] < selcache[index])
                                                break;
                                }
                        }