65 item->identifier !=
nullptr;
68 if (item->name !=
nullptr && item->identifier[0] !=
'\0') {
71 bNode &node = params.add_node(
"FunctionNodeBooleanMath");
72 node.custom1 = operation;
73 params.update_and_connect_available_socket(node,
"Boolean");
81 static auto exec_preset = mf::build::exec_presets::AllSpanOrSingle();
82 static auto and_fn = mf::build::SI2_SO<bool, bool, bool>(
83 "And", [](
bool a,
bool b) {
return a &&
b; }, exec_preset);
84 static auto or_fn = mf::build::SI2_SO<bool, bool, bool>(
85 "Or", [](
bool a,
bool b) {
return a ||
b; }, exec_preset);
86 static auto not_fn = mf::build::SI1_SO<bool, bool>(
87 "Not", [](
bool a) {
return !a; }, exec_preset);
88 static auto nand_fn = mf::build::SI2_SO<bool, bool, bool>(
89 "Not And", [](
bool a,
bool b) {
return !(a &&
b); }, exec_preset);
90 static auto nor_fn = mf::build::SI2_SO<bool, bool, bool>(
91 "Nor", [](
bool a,
bool b) {
return !(a ||
b); }, exec_preset);
92 static auto xnor_fn = mf::build::SI2_SO<bool, bool, bool>(
93 "Equal", [](
bool a,
bool b) {
return a ==
b; }, exec_preset);
94 static auto xor_fn = mf::build::SI2_SO<bool, bool, bool>(
95 "Not Equal", [](
bool a,
bool b) {
return a !=
b; }, exec_preset);
96 static auto imply_fn = mf::build::SI2_SO<bool, bool, bool>(
97 "Imply", [](
bool a,
bool b) {
return !a ||
b; }, exec_preset);
98 static auto nimply_fn = mf::build::SI2_SO<bool, bool, bool>(
99 "Subtract", [](
bool a,
bool b) {
return a && !
b; }, exec_preset);
138 params.set_output_elem(
"Boolean",
params.get_input_elem<BoolElem>(
"Boolean"));
153 params.set_input_elem(
"Boolean",
params.get_output_elem<BoolElem>(
"Boolean"));
165 const StringRef first_input_id =
"Boolean";
169 params.set_input(first_input_id, !
params.get_output<
bool>(output_id));
193 ntype.
ui_name =
"Boolean Math";
194 ntype.
ui_description =
"Perform a logical operation on the given boolean inputs";
#define NODE_CLASS_CONVERTER
#define FN_NODE_BOOLEAN_MATH
#define BLI_assert_unreachable()
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
@ NODE_BOOLEAN_MATH_IMPLY
@ NODE_BOOLEAN_MATH_NIMPLY
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_inline_enum_accessors(member)
void set_matching_fn(const mf::MultiFunction *fn)
void node_register_type(bNodeType &ntype)
void node_set_socket_availability(bNodeTree &ntree, bNodeSocket &sock, bool is_available)
static const mf::MultiFunction * get_multi_function(const bNode &bnode)
static void node_eval_inverse(inverse_eval::InverseEvalParams ¶ms)
static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms)
static void node_label(const bNodeTree *, const bNode *node, char *label, int label_maxncpy)
static void node_layout(uiLayout *layout, bContext *, PointerRNA *ptr)
static void node_eval_inverse_elem(value_elem::InverseElemEvalParams ¶ms)
static void node_declare(NodeDeclarationBuilder &b)
static void node_build_multi_function(NodeMultiFunctionBuilder &builder)
static void node_rna(StructRNA *srna)
static void node_update(bNodeTree *ntree, bNode *node)
static void node_eval_elem(value_elem::ElemEvalParams ¶ms)
static void node_register()
PropertyRNA * RNA_def_node_enum(StructRNA *srna, const char *identifier, const char *ui_name, const char *ui_description, const EnumPropertyItem *static_items, const EnumRNAAccessors accessors, std::optional< int > default_value, const EnumPropertyItemFunc item_func, const bool allow_animation)
void fn_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
bool RNA_enum_name(const EnumPropertyItem *item, const int value, const char **r_name)
const EnumPropertyItem rna_enum_node_boolean_math_items[]
NodeInverseElemEvalFunction eval_inverse_elem
NodeInverseEvalFunction eval_inverse
std::string ui_description
void(* labelfunc)(const bNodeTree *ntree, const bNode *node, char *label, int label_maxncpy)
NodeElemEvalFunction eval_elem
NodeMultiFunctionBuildFunction build_multi_function
const char * enum_name_legacy
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
NodeDeclareFunction declare
void(* updatefunc)(bNodeTree *ntree, bNode *node)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)