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:
Diffstat (limited to 'source/blender/nodes/function/nodes/node_fn_boolean_math.cc')
-rw-r--r--source/blender/nodes/function/nodes/node_fn_boolean_math.cc27
1 files changed, 25 insertions, 2 deletions
diff --git a/source/blender/nodes/function/nodes/node_fn_boolean_math.cc b/source/blender/nodes/function/nodes/node_fn_boolean_math.cc
index cd05f07d392..15b0bab22b7 100644
--- a/source/blender/nodes/function/nodes/node_fn_boolean_math.cc
+++ b/source/blender/nodes/function/nodes/node_fn_boolean_math.cc
@@ -43,8 +43,7 @@ static void node_boolean_math_update(bNodeTree *ntree, bNode *node)
{
bNodeSocket *sockB = (bNodeSocket *)BLI_findlink(&node->inputs, 1);
- nodeSetSocketAvailability(
- ntree, sockB, ELEM(node->custom1, NODE_BOOLEAN_MATH_AND, NODE_BOOLEAN_MATH_OR));
+ nodeSetSocketAvailability(ntree, sockB, !ELEM(node->custom1, NODE_BOOLEAN_MATH_NOT));
}
static void node_boolean_math_label(const bNodeTree *UNUSED(ntree),
@@ -67,6 +66,18 @@ static const fn::MultiFunction *get_multi_function(bNode &bnode)
static fn::CustomMF_SI_SI_SO<bool, bool, bool> or_fn{"Or",
[](bool a, bool b) { return a || b; }};
static fn::CustomMF_SI_SO<bool, bool> not_fn{"Not", [](bool a) { return !a; }};
+ static fn::CustomMF_SI_SI_SO<bool, bool, bool> nand_fn{"Not And",
+ [](bool a, bool b) { return !(a && b); }};
+ static fn::CustomMF_SI_SI_SO<bool, bool, bool> nor_fn{"Nor",
+ [](bool a, bool b) { return !(a || b); }};
+ static fn::CustomMF_SI_SI_SO<bool, bool, bool> xnor_fn{"Equal",
+ [](bool a, bool b) { return a == b; }};
+ static fn::CustomMF_SI_SI_SO<bool, bool, bool> xor_fn{"Not Equal",
+ [](bool a, bool b) { return a != b; }};
+ static fn::CustomMF_SI_SI_SO<bool, bool, bool> imply_fn{"Imply",
+ [](bool a, bool b) { return !a || b; }};
+ static fn::CustomMF_SI_SI_SO<bool, bool, bool> nimply_fn{"Subtract",
+ [](bool a, bool b) { return a && !b; }};
switch (bnode.custom1) {
case NODE_BOOLEAN_MATH_AND:
@@ -75,6 +86,18 @@ static const fn::MultiFunction *get_multi_function(bNode &bnode)
return &or_fn;
case NODE_BOOLEAN_MATH_NOT:
return &not_fn;
+ case NODE_BOOLEAN_MATH_NAND:
+ return &nand_fn;
+ case NODE_BOOLEAN_MATH_NOR:
+ return &nor_fn;
+ case NODE_BOOLEAN_MATH_XNOR:
+ return &xnor_fn;
+ case NODE_BOOLEAN_MATH_XOR:
+ return &xor_fn;
+ case NODE_BOOLEAN_MATH_IMPLY:
+ return &imply_fn;
+ case NODE_BOOLEAN_MATH_NIMPLY:
+ return &nimply_fn;
}
BLI_assert_unreachable();