[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36779] trunk/blender/source/blender/ blenkernel/intern/fcurve.c: modify fcurve evaluation for bool/enum/ int values.
Campbell Barton
ideasman42 at gmail.com
Thu May 19 14:39:57 CEST 2011
Revision: 36779
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36779
Author: campbellbarton
Date: 2011-05-19 12:39:57 +0000 (Thu, 19 May 2011)
Log Message:
-----------
modify fcurve evaluation for bool/enum/int values. was converting from a float to an int which means 0.9x evaluates to 0.0, negative numbers are also rounded up.
Round at 0.5 instead & treat negative numbers the same.
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/intern/fcurve.c
Modified: trunk/blender/source/blender/blenkernel/intern/fcurve.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/fcurve.c 2011-05-19 12:37:26 UTC (rev 36778)
+++ trunk/blender/source/blender/blenkernel/intern/fcurve.c 2011-05-19 12:39:57 UTC (rev 36779)
@@ -2039,7 +2039,7 @@
* 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;
More information about the Bf-blender-cvs
mailing list