29 b.add_input(data_type,
"Value"_ustr);
31 b.add_input<
decl::Int>(
"Seed"_ustr,
"Seed"_ustr);
49 static auto exec_preset = mf::build::exec_presets::AllSpanOrSingle();
51 static auto fn_hash_float = mf::build::SI2_SO<float, int, int>(
55 static auto fn_hash_vector = mf::build::SI2_SO<float3, int, int>(
59 static auto fn_hash_color = mf::build::SI2_SO<ColorGeometry4f, int, int>(
63 static auto fn_hash_int = mf::build::SI2_SO<int, int, int>(
67 static auto fn_hash_string = mf::build::SI2_SO<std::string, int, int>(
71 static auto fn_hash_rotation = mf::build::SI2_SO<math::Quaternion, int, int>(
75 static auto fn_hash_matrix = mf::build::SI2_SO<float4x4, int, int>(
80 switch (socket_type) {
82 return &fn_hash_matrix;
84 return &fn_hash_rotation;
86 return &fn_hash_string;
88 return &fn_hash_float;
90 return &fn_hash_vector;
92 return &fn_hash_color;
122 if (!
ELEM(socket_type,
154 return "hash_value_float";
156 return "hash_value_vector";
158 return "hash_value_color";
160 return "hash_value_int";
162 return "hash_value_rotation";
164 return "hash_value_matrix";
184 if (name ==
nullptr) {
222 ntype.
ui_description =
"Generate a randomized integer using the given input value as a seed";
#define NODE_CLASS_CONVERTER
#define FN_NODE_HASH_VALUE
#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 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)
eNodeSocketDatatype socket_type
void operator()(LinkSearchOpParams ¶ms)
void node_register_type(bNodeType &ntype)
QuaternionBase< float > Quaternion
static const mf::MultiFunction * get_multi_function(const bNode &bnode)
static void node_build_multi_function(NodeMultiFunctionBuilder &builder)
static void node_init(bNodeTree *, bNode *node)
static void node_declare(NodeDeclarationBuilder &b)
static void node_layout(ui::Layout &layout, bContext *, PointerRNA *ptr)
static void node_register()
static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms)
static const char * gpu_shader_get_name(const eNodeSocketDatatype data_type)
static void node_rna(StructRNA *srna)
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)
const EnumPropertyItem * enum_items_filter(const EnumPropertyItem *original_item_array, FunctionRef< bool(const EnumPropertyItem &item)> fn)
uint32_t hash_float(float kx)
uint32_t hash(uint32_t kx)
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
void fn_cmp_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
MatBase< float, 4, 4 > float4x4
VecBase< float, 4 > float4
BLI_INLINE unsigned int BLI_hash_string(const char *str)
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
const EnumPropertyItem rna_enum_node_socket_data_type_items[]
VecBase< float, 3 > float3
void(*) draw_buttons(ui::Layout &, bContext *C, PointerRNA *ptr)
std::string ui_description
NodeGPUExecFunction gpu_fn
NodeMultiFunctionBuildFunction build_multi_function
void(*) initfunc(bNodeTree *ntree, bNode *node)
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)