23static_assert(-1 == ~0,
"Two's complement must be used for bitwise operations.");
41 "Returns a value where the bits of A and B are both set"},
46 "Returns a value where the bits of either A or B are set"},
51 "Returns a value where only one bit from A and B is set"},
56 "Returns the opposite bit value of A, in decimal it is equivalent of A = -A - 1"},
61 "Shifts the bit values of A by the specified Shift amount. Positive values shift left, "
62 "negative values shift right."},
67 "Rotates the bit values of A by the specified Shift amount. Positive values rotate left, "
68 "negative values rotate right."},
69 {0,
nullptr, 0,
nullptr,
nullptr},
79 auto &b_socket =
b.add_input<
decl::Int>(
"B"_ustr);
85 b_socket.available(!
ELEM(
120 if (item.name !=
nullptr && item.identifier[0] !=
'\0') {
132 const char *operation_name =
IFACE_(
"Unknown");
171 return "bit_math_and";
173 return "bit_math_or";
175 return "bit_math_xor";
177 return "bit_math_not";
179 return "bit_math_shift";
181 return "bit_math_rotate";
197 if (name ==
nullptr) {
254 ntype.
ui_description =
"Perform bitwise operations on 32-bit integers";
#define NODE_CLASS_CONVERTER
#define BLT_I18NCONTEXT_DEFAULT
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_inline_enum_accessors(member)
#define BLI_assert_unreachable()
void add_item(std::string socket_name, SocketLinkOperation::LinkSocketFn fn, int weight=0)
const bNodeTree & node_tree() const
const bNodeSocket & other_socket() const
eNodeSocketInOut in_out() const
void update_and_connect_available_socket(bNode &new_node, UString socket_name)
bNode & add_node(UString idname)
void set_matching_fn(const mf::MultiFunction *fn)
void operator()(LinkSearchOpParams ¶ms)
BitMathOperation operation
void node_register_type(bNodeType &ntype)
const MultiFunction & lookup(UString id)
static void node_build_multi_function(NodeMultiFunctionBuilder &builder)
static constexpr int32_t max_shift
const std::array< EnumPropertyItem, 7 > bit_math_operation_items
static void node_declare(NodeDeclarationBuilder &b)
static constexpr int32_t min_shift
static void node_layout(ui::Layout &layout, bContext *, PointerRNA *ptr)
static const char * gpu_shader_get_name(const BitMathOperation operation)
static void node_register()
static const mf::MultiFunction * get_multi_function(const bNode &bnode)
static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms)
static int node_gpu_material(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void node_label(const bNodeTree *, const bNode *node, char *label, int label_maxncpy)
static void node_rna(StructRNA *srna)
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)
size_t size_t size_t BLI_snprintf_utf8(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
GPUNodeLink * GPU_node_get_input_link(const bNode &node, GPUNodeStack inputs[], StringRef identifier)
void fn_cmp_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
bool GPU_link(GPUMaterial *mat, const char *name,...)
GPUNodeStack & GPU_node_get_output(const bNode &node, GPUNodeStack outputs[], StringRef identifier)
void rna_Node_socket_update(Main *bmain, Scene *scene, PointerRNA *ptr)
bool RNA_enum_name_gettexted(const EnumPropertyItem *item, int value, const char *translation_context, const char **r_name)
void RNA_def_property_update_runtime(PropertyRNA *prop, RNAPropertyUpdateFunc func)
bke::bNodeTreeType * typeinfo
bool(*) validate_link(eNodeSocketDatatype from, eNodeSocketDatatype to)
void(*) draw_buttons(ui::Layout &, bContext *C, PointerRNA *ptr)
std::string ui_description
void(*) labelfunc(const bNodeTree *ntree, const bNode *node, char *label, int label_maxncpy)
NodeGPUExecFunction gpu_fn
NodeMultiFunctionBuildFunction build_multi_function
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
NodeDeclareFunction declare
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< StringRef > name_opt, int icon, std::optional< StringRef > placeholder=std::nullopt)