Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2022-05-24 10:49:58 +0300
committerJacques Lucke <jacques@blender.org>2022-05-24 10:49:58 +0300
commite07b1b8316392ebf3c51a4671d8b56dc4b222f02 (patch)
treecf966ea81bcbb8709715d5b62fa77fc7f55172d9
parent5744e7d24783077e7acfcd8d56d78af51c33a2ff (diff)
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.
-rw-r--r--source/blender/nodes/function/nodes/node_fn_compare.cc4
1 files changed, 2 insertions, 2 deletions
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};