Fix #110169: nearly flat normalized fcurves jump around in editor #110796

Merged
Nathan Vegdahl merged 3 commits from nathanvegdahl/blender:fix_110169_broken_fcurve_normalization into main 2023-08-07 10:53:10 +02:00

3 Commits

Author SHA1 Message Date
Nathan Vegdahl f43ee5d23e Bump up the minimum ulp difference to normalize an fcurve
buildbot/vexp-code-patch-coordinator Build done. Details
2023-08-04 18:33:00 +02:00
Nathan Vegdahl e5d2c923d1 Fix: compare_ff_relative() could be wrong with floats of different signs
Specifically, when relying on the ulps code path.  This commit changes
it to use the more robust ulp_diff_ff() for its ulps code path.
2023-08-04 18:16:09 +02:00
Nathan Vegdahl d7f5974ad6 Fix #110169: nearly flat normalized fcurves jump around in editor
The root cause was a classic fixed-size epsilon issue.  The code that
checked if an fcurve was effectively flat, and thus shouldn't be
normalized, used a fixed-size epsilon that was reasonable for values
close-ish to zero, but didn't work well for values >= 1.0.

This patch addresses the issue by introducing a robust ulps-based
comparison, to ensure that a minimum number of representable floats
exist between the min/max values of the curve.  This approach scales
appropriately up and down to both huge and tiny values.
2023-08-04 15:44:27 +02:00