modify fcurve evaluation for bool/enum/int values. was converting from a float to...
authorCampbell Barton <ideasman42@gmail.com>
Thu, 19 May 2011 12:39:57 +0000 (12:39 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 19 May 2011 12:39:57 +0000 (12:39 +0000)
Round at 0.5 instead & treat negative numbers the same.

source/blender/blenkernel/intern/fcurve.c

index b1272ee2d53871b69d58aa9a65e88e65b86d4ca1..d6a9d950015094cc768f3f6e79189f9e4d41e306 100644 (file)
@@ -2039,7 +2039,7 @@ float evaluate_fcurve (FCurve *fcu, float evaltime)
         * here so that the curve can be sampled correctly
         */
        if (fcu->flag & FCURVE_INT_VALUES)
-               cvalue= (float)((int)cvalue);
+               cvalue= floorf(cvalue + 0.5f);
        
        /* return evaluated value */
        return cvalue;