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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user