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.
This commit is contained in:
Jacques Lucke 2022-05-24 09:49:58 +02:00
parent 5744e7d247
commit e07b1b8316
Notes: blender-bot 2023-02-14 06:46:23 +01:00
Referenced by issue #98317, Equal Vs. Not Equal does not have opposite effect.
1 changed files with 2 additions and 2 deletions

View File

@ -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};