18#include "RNA_prototypes.hh"
35 bNode *current_node =
static_cast<bNode *
>(current_node_ptr->
data);
50 current_node_ptr->
owner_id, &RNA_Node, &output_node);
54 C, panel, ntree, output_node);
56 ntree, output_node, [&](
PointerRNA *item_ptr) {
57 panel->use_property_split_set(
true);
58 panel->use_property_decorate_set(
false);
59 panel->prop(item_ptr,
"socket_type",
UI_ITEM_NONE, std::nullopt, ICON_NONE);
63 layout->
prop(&output_node_ptr,
"inspection_index",
UI_ITEM_NONE, std::nullopt, ICON_NONE);
72 b.use_custom_socket_order();
73 b.allow_any_socket_order();
75 .description(
"Index of the current iteration. Starts counting at zero");
78 const bNode *node =
b.node_or_null();
84 output_node->storage);
85 for (
const int i :
IndexRange(output_storage.items_num)) {
90 auto &input_decl =
b.add_input(socket_type,
name, identifier)
93 auto &output_decl =
b.add_output(socket_type,
name, identifier).align_with_previous();
95 input_decl.supports_field();
96 output_decl.dependent_field({input_decl.index()});
98 input_decl.structure_type(StructureType::Dynamic);
99 output_decl.structure_type(StructureType::Dynamic);
103 b.add_input<
decl::Extend>(
"",
"__extend__").structure_type(StructureType::Dynamic);
105 .structure_type(StructureType::Dynamic)
106 .align_with_previous();
113 data->output_node_id = 0;
120 const int label_maxncpy)
127 bNode *output_node =
params.ntree.node_by_id(node_storage(
params.node).output_node_id);
141 int zone_id = node_storage(*node).output_node_id;
149 ntype.
ui_name =
"Repeat Input";
174 b.use_custom_socket_order();
175 b.allow_any_socket_order();
177 const bNode *node =
b.node_or_null();
185 auto &input_decl =
b.add_input(socket_type,
name, identifier)
188 auto &output_decl =
b.add_output(socket_type,
name, identifier).align_with_previous();
190 input_decl.supports_field();
191 output_decl.dependent_field({input_decl.index()});
193 input_decl.structure_type(StructureType::Dynamic);
194 output_decl.structure_type(StructureType::Dynamic);
197 b.add_input<
decl::Extend>(
"",
"__extend__").structure_type(StructureType::Dynamic);
199 .structure_type(StructureType::Dynamic)
200 .align_with_previous();
207 data->next_identifier = 0;
213 data->items[0].identifier =
data->next_identifier++;
230 dst_node->
storage = dst_storage;
255 bNode &input_node =
params.add_node(
"GeometryNodeRepeatInput");
256 bNode &output_node =
params.add_node(
"GeometryNodeRepeatOutput");
271 params.connect_available_socket(output_node,
params.socket.name);
274 params.connect_available_socket(input_node,
params.socket.name);
276 params.node_tree.ensure_topology_cache();
279 input_node.output_socket(1),
281 output_node.input_socket(0));
309 ntype.
ui_name =
"Repeat Output";
#define NODE_CLASS_INTERFACE
#define NODE_STORAGE_FUNCS(StorageT)
#define GEO_NODE_REPEAT_OUTPUT
#define GEO_NODE_REPEAT_INPUT
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
void BLO_read_string(BlendDataReader *reader, char **ptr_p)
void BLO_write_string(BlendWriter *writer, const char *data_ptr)
#define BLT_I18NCONTEXT_ID_NODETREE
#define CTX_IFACE_(context, msgid)
bool GPU_stack_link_zone(GPUMaterial *material, const bNode *bnode, const char *name, GPUNodeStack *in, GPUNodeStack *out, int zone_index, bool is_zone_end, int in_argument_count, int out_argument_count)
#define NOD_REGISTER_NODE(REGISTER_FUNC)
BMesh const char void * data
std::optional< int > output_node_id
const bNode * output_node() const
const bNodeTreeZone * get_zone_by_node(const int32_t node_id) const
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_callocN(size_t len, const char *str)
void * MEM_dupallocN(const void *vmemh)
void MEM_freeN(void *vmemh)
void node_register_type(bNodeType &ntype)
bNodeLink & node_add_link(bNodeTree &ntree, bNode &fromnode, bNodeSocket &fromsock, bNode &tonode, bNodeSocket &tosock)
void node_type_storage(bNodeType &ntype, std::optional< StringRefNull > storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
static void node_copy_storage(bNodeTree *, bNode *dst_node, const bNode *src_node)
static void node_blend_read(bNodeTree &, bNode &node, BlendDataReader &reader)
static void node_free_storage(bNode *node)
static int node_shader_fn(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms)
static void node_blend_write(const bNodeTree &, const bNode &node, BlendWriter &writer)
static void node_register()
static void node_declare(NodeDeclarationBuilder &b)
static void node_operators()
static bool node_insert_link(bke::NodeInsertLinkParams ¶ms)
static void node_init(bNodeTree *tree, bNode *node)
static void node_layout_ex(uiLayout *layout, bContext *C, PointerRNA *current_node_ptr)
void make_common_operators()
static void draw_items_list_with_operators(const bContext *C, uiLayout *layout, const bNodeTree &tree, const bNode &node)
static void draw_active_item_props(const bNodeTree &tree, const bNode &node, const FunctionRef< void(PointerRNA *item_ptr)> draw_item)
void blend_write(BlendWriter *writer, const bNode &node)
void destruct_array(bNode &node)
void blend_read_data(BlendDataReader *reader, bNode &node)
void copy_array(const bNode &src_node, bNode &dst_node)
Accessor::ItemT * add_item_with_socket_type_and_name(bNodeTree &ntree, bNode &node, const eNodeSocketDatatype socket_type, const char *name, std::optional< int > dimensions=std::nullopt)
bool try_add_item_via_any_extend_socket(bNodeTree &ntree, bNode &extend_node, bNode &storage_node, bNodeLink &link, const std::optional< StringRef > socket_identifier=std::nullopt, typename Accessor::ItemT **r_new_item=nullptr)
void update_node_declaration_and_sockets(bNodeTree &ntree, bNode &node)
bool socket_type_supports_fields(const eNodeSocketDatatype socket_type)
void sh_geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
NodeBlendWriteFunction blend_write_storage_content
NodeBlendDataReadFunction blend_data_read_storage_content
void(* initfunc)(bNodeTree *ntree, bNode *node)
void(* labelfunc)(const bNodeTree *ntree, const bNode *node, char *label, int label_maxncpy)
NodeGPUExecFunction gpu_fn
void(* draw_buttons_ex)(uiLayout *, bContext *C, PointerRNA *ptr)
const char * enum_name_legacy
bool(* insert_link)(NodeInsertLinkParams ¶ms)
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
NodeDeclareFunction declare
void(* register_operators)()
static void blend_write_item(BlendWriter *writer, const ItemT &item)
static StructRNA * item_srna
static bool supports_socket_type(const eNodeSocketDatatype socket_type, const int ntree_type)
static void blend_read_data_item(BlendDataReader *reader, ItemT &item)
static std::string socket_identifier_for_item(const NodeRepeatItem &item)
PanelLayout panel(const bContext *C, blender::StringRef idname, bool default_closed)
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)