25 bNode *current_node =
static_cast<bNode *
>(current_node_ptr->
data);
46 panel->prop(item_ptr,
"socket_type",
UI_ITEM_NONE, std::nullopt, ICON_NONE);
56 panel->prop(item_ptr,
"socket_type",
UI_ITEM_NONE, std::nullopt, ICON_NONE);
68 const bNode *node =
b.node_or_null();
76 for (
const int i :
IndexRange(output_storage.input_items.items_num)) {
80 b.add_output(socket_type, item.
name, identifier);
90 const int label_maxncpy)
115 ntype.
ui_name =
"Closure Input";
139 const bNode *node =
b.node_or_null();
146 b.add_input(socket_type, item.
name, identifier);
163 dst_node->
storage = dst_storage;
179 *ntree, *node, *node, *link);
189 bNode &closure_input_node,
190 bNode &closure_output_node)
192 snode.
edittree->ensure_topology_cache();
193 bNodeSocket &closure_socket = closure_output_node.output_socket(0);
197 snode, compute_context_cache, closure_socket);
198 if (!current_context) {
205 current_context, closure_socket, compute_context_cache, std::nullopt);
206 if (!evaluate_context_generic) {
211 evaluate_context_generic);
212 if (!evaluate_context) {
215 const bNode *evaluate_node = evaluate_context->node();
216 if (!evaluate_node) {
221 for (
const int i :
IndexRange(storage->input_items.items_num)) {
226 for (
const int i :
IndexRange(storage->output_items.items_num)) {
237 snode.
edittree->ensure_topology_cache();
239 for (
const bNodeSocket *eval_output_socket : evaluate_node->output_sockets()) {
241 *eval_output_socket);
242 if (!eval_input_socket) {
245 internal_links.
append({&closure_input_node.output_socket(eval_input_socket->index() - 1),
246 &closure_output_node.input_socket(eval_output_socket->index())});
248 for (
auto &&[from_socket, to_socket] : internal_links) {
250 *snode.
edittree, closure_input_node, *from_socket, closure_output_node, *to_socket);
294 ntype.
ui_name =
"Closure Output";
SpaceNode * CTX_wm_space_node(const bContext *C)
#define NODE_CLASS_INTERFACE
#define NODE_STORAGE_FUNCS(StorageT)
#define GEO_NODE_CLOSURE_OUTPUT
#define GEO_NODE_CLOSURE_INPUT
void BKE_ntree_update_tag_node_property(bNodeTree *ntree, bNode *node)
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 NOD_REGISTER_NODE(REGISTER_FUNC)
BMesh const char void * data
void append(const T &value)
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_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))
const ComputeContext * compute_context_for_edittree_socket(const SpaceNode &snode, bke::ComputeContextCache &compute_context_cache, const bNodeSocket &socket)
const ComputeContext * compute_context_for_closure_evaluation(const ComputeContext *closure_socket_context, const bNodeSocket &closure_socket, bke::ComputeContextCache &compute_context_cache, const std::optional< nodes::ClosureSourceLocation > &source_location)
static void node_free_storage(bNode *node)
static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms)
static void node_register()
static void node_init(bNodeTree *, bNode *node)
static bool node_insert_link(bNodeTree *ntree, bNode *node, bNodeLink *link)
static void try_initialize_closure_from_evaluator(SpaceNode &snode, bNode &closure_input_node, bNode &closure_output_node)
static void node_blend_write(const bNodeTree &, const bNode &node, BlendWriter &writer)
static void node_operators()
static void node_declare(NodeDeclarationBuilder &b)
static void node_blend_read(bNodeTree &, bNode &node, BlendDataReader &reader)
static void node_copy_storage(bNodeTree *, bNode *dst_node, const bNode *src_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(bNode &node, const eNodeSocketDatatype socket_type, const char *name)
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)
void update_node_declaration_and_sockets(bNodeTree &ntree, bNode &node)
const bNodeSocket * evaluate_closure_node_internally_linked_input(const bNodeSocket &output_socket)
void 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)
NodeGeometryClosureOutputItem * items
NodeGeometryClosureOutputItems output_items
struct bNodeTree * edittree
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)
void(* draw_buttons_ex)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
bool(* insert_link)(bNodeTree *ntree, bNode *node, bNodeLink *link)
NodeDeclareFunction declare
void(* register_operators)()
static void blend_write_item(BlendWriter *writer, const ItemT &item)
static std::string socket_identifier_for_item(const ItemT &item)
static StructRNA * item_srna
static void blend_read_data_item(BlendDataReader *reader, ItemT &item)
NodeGeometryClosureOutputItem ItemT
PanelLayout panel(const bContext *C, blender::StringRef idname, bool default_closed)