[Bf-blender-cvs] [a99639792b1] master: Fix T97097: Color Filter saturates colors that have no saturation

Joseph Eagar noreply at git.blender.org
Mon Apr 11 19:24:52 CEST 2022


Commit: a99639792b1628493139eb9943ae4befbdc6b613
Author: Joseph Eagar
Date:   Mon Apr 11 10:24:01 2022 -0700
Branches: master
https://developer.blender.org/rBa99639792b1628493139eb9943ae4befbdc6b613

Fix T97097: Color Filter saturates colors that have no saturation

===================================================================

M	source/blender/editors/sculpt_paint/sculpt_filter_color.c

===================================================================

diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_color.c b/source/blender/editors/sculpt_paint/sculpt_filter_color.c
index ebebd9efd80..a5bd87117fc 100644
--- a/source/blender/editors/sculpt_paint/sculpt_filter_color.c
+++ b/source/blender/editors/sculpt_paint/sculpt_filter_color.c
@@ -129,8 +129,14 @@ static void color_filter_task_cb(void *__restrict userdata,
         break;
       case COLOR_FILTER_SATURATION:
         rgb_to_hsv_v(orig_color, hsv_color);
-        hsv_color[1] = clamp_f(hsv_color[1] + fade, 0.0f, 1.0f);
-        hsv_to_rgb_v(hsv_color, final_color);
+
+        if (hsv_color[1] != 0.0f) {
+          hsv_color[1] = clamp_f(hsv_color[1] + fade, 0.0f, 1.0f);
+          hsv_to_rgb_v(hsv_color, final_color);
+        }
+        else {
+          copy_v3_v3(final_color, orig_color);
+        }
         break;
       case COLOR_FILTER_VALUE:
         rgb_to_hsv_v(orig_color, hsv_color);



More information about the Bf-blender-cvs mailing list