29 switch (
node.custom1) {
38 switch (
node.custom1) {
40 return IFACE_(
"Multiplier");
48 switch (
node.custom1) {
65 const bool one_input_ops =
ELEM(
128 if (item->name !=
nullptr && item->identifier[0] !=
'\0') {
130 SocketSearchOp{
"Value"_ustr, NodeIntegerMathOperation(item->value)},
203 return "integer_math_add";
205 return "integer_math_subtract";
207 return "integer_math_multiply";
209 return "integer_math_divide";
211 return "integer_math_multiply_add";
213 return "integer_math_power";
215 return "integer_math_floored_modulo";
217 return "integer_math_absolute";
219 return "integer_math_minimum";
221 return "integer_math_maximum";
223 return "integer_math_gcd";
225 return "integer_math_lcm";
227 return "integer_math_negate";
229 return "integer_math_sign";
231 return "integer_math_divide_floor";
233 return "integer_math_divide_ceil";
235 return "integer_math_divide_round";
237 return "integer_math_modulo";
252 if (name ==
nullptr) {
268 IntElem output_elem = params.
get_input_elem<IntElem>(
"Value"_ustr);
269 output_elem.merge(params.
get_input_elem<IntElem>(
"Value_001"_ustr));
298 const UString first_input_id =
"Value"_ustr;
299 const UString second_input_id =
"Value_001"_ustr;
300 const UString output_id =
"Value"_ustr;
315 params.
get_input<
int>(second_input_id)));
349 ntype.
ui_name =
"Integer Math";
350 ntype.
ui_description =
"Perform various math operations on the given integer inputs";
#define NODE_CLASS_CONVERTER
#define FN_NODE_INTEGER_MATH
#define CTX_N_(context, msgid)
#define BLT_I18NCONTEXT_ID_NODETREE
#define CTX_IFACE_(context, msgid)
#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
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)
T get_output(const UString identifier) const
void set_input(const UString identifier, T value)
T get_input(const UString identifier) const
NodeIntegerMathOperation operation
void operator()(LinkSearchOpParams ¶ms)
T get_input_elem(const UString identifier) const
void set_output_elem(const UString identifier, T elem)
T get_output_elem(const UString identifier) const
void set_input_elem(const UString identifier, T elem)
void node_register_type(bNodeType &ntype)
void node_set_socket_availability(bNodeTree &ntree, bNodeSocket &sock, bool is_available)
bNodeSocket * node_find_socket(bNode &node, eNodeSocketInOut in_out, UString identifier)
const MultiFunction & lookup(UString id)
T safe_divide(const T &a, const T &b)
static void node_rna(StructRNA *srna)
static void node_build_multi_function(NodeMultiFunctionBuilder &builder)
static void node_layout(ui::Layout &layout, bContext *, PointerRNA *ptr)
static void int_math_input_defaults(bNode &node, const NodeIntegerMathOperation operation)
static const mf::MultiFunction * get_multi_function(const bNode &bnode)
static void node_label(const bNodeTree *, const bNode *node, char *label, int label_maxncpy)
static void node_eval_elem(value_elem::ElemEvalParams ¶ms)
static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms)
static void node_register()
static void node_declare(NodeDeclarationBuilder &b)
static const char * gpu_shader_get_name(const NodeIntegerMathOperation operation)
static void node_eval_inverse_elem(value_elem::InverseElemEvalParams ¶ms)
static void node_eval_inverse(inverse_eval::InverseEvalParams ¶ms)
static void node_update(bNodeTree *ntree, bNode *node)
static int node_gpu_material(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
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)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
@ NODE_INTEGER_MATH_DIVIDE
@ NODE_INTEGER_MATH_DIVIDE_CEIL
@ NODE_INTEGER_MATH_MODULO
@ NODE_INTEGER_MATH_FLOORED_MODULO
@ NODE_INTEGER_MATH_MULTIPLY_ADD
@ NODE_INTEGER_MATH_DIVIDE_ROUND
@ NODE_INTEGER_MATH_MULTIPLY
@ NODE_INTEGER_MATH_MINIMUM
@ NODE_INTEGER_MATH_ABSOLUTE
@ NODE_INTEGER_MATH_POWER
@ NODE_INTEGER_MATH_NEGATE
@ NODE_INTEGER_MATH_MAXIMUM
@ NODE_INTEGER_MATH_SUBTRACT
@ NODE_INTEGER_MATH_DIVIDE_FLOOR
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
bool RNA_enum_name(const EnumPropertyItem *item, const int value, const char **r_name)
const EnumPropertyItem rna_enum_node_integer_math_items[]
void rna_Node_socket_update(Main *bmain, Scene *scene, PointerRNA *ptr)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_update_runtime(PropertyRNA *prop, RNAPropertyUpdateFunc func)
void common_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
struct bNodeSocket * next
bke::bNodeTreeType * typeinfo
bool(*) validate_link(eNodeSocketDatatype from, eNodeSocketDatatype to)
NodeInverseElemEvalFunction eval_inverse_elem
void(*) draw_buttons(ui::Layout &, bContext *C, PointerRNA *ptr)
NodeInverseEvalFunction eval_inverse
std::string ui_description
void(*) updatefunc(bNodeTree *ntree, bNode *node)
void(*) labelfunc(const bNodeTree *ntree, const bNode *node, char *label, int label_maxncpy)
NodeGPUExecFunction gpu_fn
NodeElemEvalFunction eval_elem
NodeMultiFunctionBuildFunction build_multi_function
const char * enum_name_legacy
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)