29 bNode *current_node =
static_cast<bNode *
>(current_node_ptr->
data);
49 layout.
op(
"node.sockets_sync",
IFACE_(
"Sync"), ICON_FILE_REFRESH);
50 layout.
prop(&output_node_ptr,
"define_signature",
UI_ITEM_NONE, std::nullopt, ICON_NONE);
53 socket_items::ui::draw_items_list_with_operators<ClosureInputItemsAccessor>(
55 socket_items::ui::draw_active_item_props<ClosureInputItemsAccessor>(
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);
66 socket_items::ui::draw_items_list_with_operators<ClosureOutputItemsAccessor>(
68 socket_items::ui::draw_active_item_props<ClosureOutputItemsAccessor>(
70 panel->use_property_split_set(
true);
71 panel->use_property_decorate_set(
false);
72 panel->prop(item_ptr,
"socket_type",
UI_ITEM_NONE, std::nullopt, ICON_NONE);
92 for (
const int i :
IndexRange(output_storage.input_items.items_num)) {
102 decl.structure_type(StructureType::Dynamic);
108 .custom_draw(socket_items::ui::draw_extend_socket_fn<ClosureInputItemsAccessor>());
114 const int label_maxncpy)
139 ntype.
ui_name =
"Closure Input";
176 decl.structure_type(StructureType::Dynamic);
181 .custom_draw(socket_items::ui::draw_extend_socket_fn<ClosureOutputItemsAccessor>());
194 auto *dst_storage = MEM_new<NodeClosureOutput>(__func__,
dna::shallow_copy(src_storage));
195 dst_node->
storage = dst_storage;
213 if (
storage.input_items.items_num == 0 &&
storage.output_items.items_num == 0) {
252 params.connect_available_socket(
output_node,
"Closure"_ustr);
275 ntype.
ui_name =
"Closure Output";
#define NODE_CLASS_INTERFACE
#define NODE_CLOSURE_OUTPUT
#define NODE_CLOSURE_INPUT
#define BLT_I18NCONTEXT_ID_NODETREE
#define CTX_IFACE_(context, msgid)
#define NOD_REGISTER_NODE(REGISTER_FUNC)
constexpr IndexRange()=default
std::optional< int > output_node_id
const bNode * output_node() const
const bNodeTreeZone * get_zone_by_node(const int32_t node_id) const
const bNode * get_corresponding_input(const bNodeTree &tree, const bNode &output_bnode) const
const bNodeSocket & other_socket() const
void add_item_full_name(std::string name, SocketLinkOperation::LinkSocketFn fn, int weight=0)
#define storage(slot, qualifiers)
const bNodeZoneType * zone_type_by_node_type(const int node_type)
void node_register_type(bNodeType &ntype)
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))
internal::ShallowDataConstRef< T > shallow_copy(const T &other)
static void node_free_storage(bNode *node)
static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms)
static void node_register()
static bool node_insert_link(bke::NodeInsertLinkParams ¶ms)
static void node_init(bNodeTree *, bNode *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)
NODE_STORAGE_FUNCS(NodeClosureOutput)
static void node_layout_ex(ui::Layout &layout, bContext *C, PointerRNA *current_node_ptr)
void make_common_operators()
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)
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 sync_sockets_closure(SpaceNode &snode, bNode &closure_input_node, bNode &closure_output_node, ReportList *reports, const bNodeSocket *src_closure_socket)
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
void sh_geo_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
BMesh const char void * data
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
SpaceNode * CTX_wm_space_node(const bContext *C)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
void node_free_standard_storage(bNode *node)
void BLO_read_string(BlendDataReader *reader, char **ptr_p)
void write_string(const char *data)
NodeSocketInterfaceStructureType structure_type
eNodeSocketDatatype socket_type
struct bNodeTree * edittree
NodeBlendWriteFunction blend_write_storage_content
void(*) register_operators()
NodeBlendDataReadFunction blend_data_read_storage_content
void(*) labelfunc(const bNodeTree *ntree, const bNode *node, char *label, int label_maxncpy)
void(*) draw_buttons_ex(ui::Layout &, bContext *C, PointerRNA *ptr)
void(*) initfunc(bNodeTree *ntree, bNode *node)
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
NodeDeclareFunction declare
bool(*) insert_link(NodeInsertLinkParams ¶ms)
static void blend_write_item(BlendWriter *writer, const ItemT &item)
static std::string socket_identifier_for_item(const ItemT &item)
static void blend_read_data_item(BlendDataReader *reader, ItemT &item)
static StructRNA ** item_srna
NodeClosureOutputItem ItemT
void use_property_decorate_set(bool is_decorate)
void use_property_split_set(bool is_sep)
PointerRNA op(wmOperatorType *ot, std::optional< StringRef > name, int icon, wm::OpCallContext context, eUI_Item_Flag flag)
PanelLayout panel(const bContext *C, StringRef idname, bool default_closed)
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)