22 b.add_input<
decl::Vector>(
"Max").default_value({1.0f, 1.0f, 1.0f}).supports_field();
23 b.add_input<
decl::Float>(
"Min",
"Min_001").supports_field();
24 b.add_input<
decl::Float>(
"Max",
"Max_001").default_value(1.0f).supports_field();
25 b.add_input<
decl::Int>(
"Min",
"Min_002").
min(-100000).max(100000).supports_field();
37 .make_available([](
bNode &node) { node_storage(node).data_type =
CD_PROP_BOOL; });
39 b.add_input<
decl::Int>(
"Seed").default_value(0).min(-10000).max(10000).supports_field();
42 b.add_output<
decl::Float>(
"Value",
"Value_001").dependent_field();
43 b.add_output<
decl::Int>(
"Value",
"Value_002").dependent_field();
44 b.add_output<
decl::Bool>(
"Value",
"Value_003").dependent_field();
93 switch (socket.
type) {
119 bNode &node =
params.add_node(
"FunctionNodeRandomValue");
120 node_storage(node).data_type = *type;
121 params.update_and_connect_available_socket(node,
"Min");
124 bNode &node =
params.add_node(
"FunctionNodeRandomValue");
125 node_storage(node).data_type = *type;
126 params.update_and_connect_available_socket(node,
"Max");
133 bNode &node =
params.add_node(
"FunctionNodeRandomValue");
134 node_storage(node).data_type = *type;
135 params.update_and_connect_available_socket(node,
"Value");
147 static auto fn = mf::build::SI4_SO<float3, float3, int, int, float3>(
153 return float3(x, y,
z) * (max_value - min_value) + min_value;
155 mf::build::exec_presets::SomeSpanOrSingle<2>());
160 static auto fn = mf::build::SI4_SO<float, float, int, int, float>(
162 [](
float min_value,
float max_value,
int id,
int seed) ->
float {
164 return value * (max_value - min_value) + min_value;
166 mf::build::exec_presets::SomeSpanOrSingle<2>());
171 static auto fn = mf::build::SI4_SO<int, int, int, int, int>(
173 [](
int min_value,
int max_value,
int id,
int seed) ->
int {
177 return floor(value * (max_value + 1 - min_value) + min_value);
179 mf::build::exec_presets::SomeSpanOrSingle<2>());
184 static auto fn = mf::build::SI3_SO<float, int, int, bool>(
186 [](
float probability,
int id,
int seed) ->
bool {
189 mf::build::exec_presets::SomeSpanOrSingle<1>());
#define NODE_CLASS_CONVERTER
#define NODE_STORAGE_FUNCS(StorageT)
#define BLI_assert_unreachable()
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
static unsigned long seed
Vector< SocketDeclaration * > inputs
void set_matching_fn(const mf::MultiFunction *fn)
local_group_size(16, 16) .push_constant(Type b
ccl_device_inline float2 floor(const float2 a)
void node_set_socket_availability(bNodeTree *ntree, bNodeSocket *sock, bool is_available)
void node_type_storage(bNodeType *ntype, const char *storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
void node_register_type(bNodeType *ntype)
static void node_register()
static void node_layout(uiLayout *layout, bContext *, PointerRNA *ptr)
static void node_declare(NodeDeclarationBuilder &b)
static void fn_node_random_value_update(bNodeTree *ntree, bNode *node)
static void node_gather_link_search_ops(GatherLinkSearchOpParams ¶ms)
static void fn_node_random_value_init(bNodeTree *, bNode *node)
static std::optional< eCustomDataType > node_type_from_other_socket(const bNodeSocket &socket)
static void node_build_multi_function(NodeMultiFunctionBuilder &builder)
void search_link_ops_for_declarations(GatherLinkSearchOpParams ¶ms, Span< SocketDeclaration * > declarations)
float hash_to_float(uint32_t kx)
VecBase< float, 3 > float3
void fn_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
struct bNodeSocket * next
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeMultiFunctionBuildFunction build_multi_function
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
NodeDeclareFunction declare
void(* updatefunc)(bNodeTree *ntree, bNode *node)