[Bf-blender-cvs] [e07b1b83163] blender-v3.2-release: Fix T98317: equal vs not-equal modes in compare node are not exact opposites

Jacques Lucke noreply at git.blender.org
Tue May 24 09:50:13 CEST 2022


Commit: e07b1b8316392ebf3c51a4671d8b56dc4b222f02
Author: Jacques Lucke
Date:   Tue May 24 09:49:58 2022 +0200
Branches: blender-v3.2-release
https://developer.blender.org/rBe07b1b8316392ebf3c51a4671d8b56dc4b222f02

Fix T98317: equal vs not-equal modes in compare node are not exact opposites

For vectors and colors to be not equal, it is enough when they are not equal
in one component.

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

M	source/blender/nodes/function/nodes/node_fn_compare.cc

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

diff --git a/source/blender/nodes/function/nodes/node_fn_compare.cc b/source/blender/nodes/function/nodes/node_fn_compare.cc
index 7bc9d2d79e8..e3f13dc7d6b 100644
--- a/source/blender/nodes/function/nodes/node_fn_compare.cc
+++ b/source/blender/nodes/function/nodes/node_fn_compare.cc
@@ -487,7 +487,7 @@ static const fn::MultiFunction *get_multi_function(bNode &node)
               static fn::CustomMF_SI_SI_SI_SO<float3, float3, float, bool> fn{
                   "Not Equal - Element-wise",
                   [](float3 a, float3 b, float epsilon) {
-                    return abs(a.x - b.x) > epsilon && abs(a.y - b.y) > epsilon &&
+                    return abs(a.x - b.x) > epsilon || abs(a.y - b.y) > epsilon ||
                            abs(a.z - b.z) > epsilon;
                   },
                   exec_preset_first_two};
@@ -522,7 +522,7 @@ static const fn::MultiFunction *get_multi_function(bNode &node)
           static fn::CustomMF_SI_SI_SI_SO<ColorGeometry4f, ColorGeometry4f, float, bool> fn{
               "Not Equal",
               [](ColorGeometry4f a, ColorGeometry4f b, float epsilon) {
-                return abs(a.r - b.r) > epsilon && abs(a.g - b.g) > epsilon &&
+                return abs(a.r - b.r) > epsilon || abs(a.g - b.g) > epsilon ||
                        abs(a.b - b.b) > epsilon;
               },
               exec_preset_first_two};



More information about the Bf-blender-cvs mailing list