From 1ac1090271ec74d1c978108e13dddaffc8a435c0 Mon Sep 17 00:00:00 2001 From: Sean Kim Date: Thu, 2 Oct 2025 19:14:04 +0200 Subject: [PATCH] Fix: 'Reset Curve' applies incorrect transformation for positive slopes Currently, the 'Reset Curve' button, corresponding to the `BKE_curvemap_reset` function, converts a predefined negative slope curve to a positive slope by inverting the order of y axis points. This has the implicit dependency on these points being at inverse x positions. For most preset curves, this works well, but for the round curve, which has points at 0, 0.5, 0.86, and 1, this condition does not hold true. To fix this, take the inverted x value for a given control point instead of the raw value. For the above example this means that the round curve now has x values at 0, 0.14, 0.5, and 1. Pull Request: https://projects.blender.org/blender/blender/pulls/147008 --- source/blender/blenkernel/intern/colortools.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blender/blenkernel/intern/colortools.cc b/source/blender/blenkernel/intern/colortools.cc index 1cea609c725..6228379f74e 100644 --- a/source/blender/blenkernel/intern/colortools.cc +++ b/source/blender/blenkernel/intern/colortools.cc @@ -433,6 +433,7 @@ void BKE_curvemap_reset(CurveMap *cuma, const rctf *clipr, int preset, CurveMapS CurveMapPoint *newpoints = static_cast(MEM_dupallocN(cuma->curve)); for (i = 0; i < cuma->totpoint; i++) { + newpoints[i].x = 1.0f - cuma->curve[last - i].x; newpoints[i].y = cuma->curve[last - i].y; }