45 static auto exec_preset = mf::build::exec_presets::AllSpanOrSingle();
46 static auto round_fn = mf::build::SI1_SO<float, int>(
47 "Round", [](
float a) {
return int(
round(a)); }, exec_preset);
48 static auto floor_fn = mf::build::SI1_SO<float, int>(
49 "Floor", [](
float a) {
return int(
floor(a)); }, exec_preset);
50 static auto ceil_fn = mf::build::SI1_SO<float, int>(
51 "Ceiling", [](
float a) {
return int(
ceil(a)); }, exec_preset);
52 static auto trunc_fn = mf::build::SI1_SO<float, int>(
53 "Truncate", [](
float a) {
return int(
trunc(a)); }, exec_preset);
81 ntype.
ui_name =
"Float to Integer";
83 "Convert the given floating-point number to an integer, with a choice of methods";
#define NODE_CLASS_CONVERTER
#define FN_NODE_FLOAT_TO_INT
#define BLI_assert_unreachable()
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define CTX_N_(context, msgid)
#define BLT_I18NCONTEXT_ID_NODETREE
#define CTX_IFACE_(context, msgid)
@ FN_NODE_FLOAT_TO_INT_TRUNCATE
@ FN_NODE_FLOAT_TO_INT_CEIL
@ FN_NODE_FLOAT_TO_INT_ROUND
@ FN_NODE_FLOAT_TO_INT_FLOOR
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void set_matching_fn(const mf::MultiFunction *fn)
void node_register_type(bNodeType &ntype)
static void node_label(const bNodeTree *, const bNode *node, char *label, int label_maxncpy)
static void node_declare(NodeDeclarationBuilder &b)
static void node_register()
static void node_layout(uiLayout *layout, bContext *, PointerRNA *ptr)
static const mf::MultiFunction * get_multi_function(const bNode &bnode)
static void node_build_multi_function(NodeMultiFunctionBuilder &builder)
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_float_to_int_items[]
std::string ui_description
void(* labelfunc)(const bNodeTree *ntree, const bNode *node, char *label, int label_maxncpy)
NodeMultiFunctionBuildFunction build_multi_function
const char * enum_name_legacy
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare
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)