33 b.use_custom_socket_order();
34 b.allow_any_socket_order();
53 auto &
decl =
b.add_input(socket_type, name, identifier)
60 decl.structure_type(StructureType::Dynamic);
65 if (flat_bundle_type) {
67 decl.try_copy_ui_data(*src_decl);
72 decl.optional_label();
77 .custom_draw(socket_items::ui::draw_extend_socket_fn<CombineBundleItemsAccessor>());
83 auto *
storage = MEM_new<NodeCombineBundle>(__func__);
90 auto *dst_storage = MEM_new<NodeCombineBundle>(__func__,
dna::shallow_copy(src_storage));
91 dst_node->
storage = dst_storage;
127 layout.
op(
"node.sockets_sync",
IFACE_(
"Sync"), ICON_FILE_REFRESH);
128 layout.
prop(node_ptr,
"define_signature",
UI_ITEM_NONE, std::nullopt, ICON_NONE);
130 socket_items::ui::draw_items_list_with_operators<CombineBundleItemsAccessor>(
131 C, panel, ntree,
node);
132 socket_items::ui::draw_active_item_props<CombineBundleItemsAccessor>(
134 panel->use_property_split_set(
true);
135 panel->use_property_decorate_set(
false);
167 node.input_socket(i).identifier_ustr());
171 params.
set_output(
"Bundle"_ustr, std::move(bundle_ptr));
197 output.allocate_single_value();
198 output.set_single_value(std::move(bundle_ptr));
253 ntype.
ui_name =
"Combine Bundle";
254 ntype.
ui_description =
"Combine multiple socket values into one.";
294 for (
const char c : name) {
304 if (std::isspace(
result[0])) {
308 const int last_index =
result.size() - 1;
309 if (std::isspace(
result[last_index])) {
#define NODE_CLASS_CONVERTER
#define NODE_COMBINE_BUNDLE
#define NOD_REGISTER_NODE(REGISTER_FUNC)
T & ensure_mutable_inplace()
constexpr IndexRange()=default
constexpr bool contains(const T &value) const
constexpr bool is_empty() const
static nodes::BundleItemValue new_bundle_item_value(Context &context, Result &result)
NodeOperation(Context &context, const bNode &node)
const bNode & node() const
Result & get_result(StringRef identifier)
Context & context() const
Result & get_input(StringRef identifier) const
static bool is_valid_key(StringRef key)
static constexpr StringRefNull forbidden_key_chars
static std::optional< BundleKey > from_str(StringRef key)
static FlatBundleTypePtr try_find_single_flat(StringRef name)
static BundleKey type_item_name
bool add(BundleKey key, const BundleItemValue &value)
static BundlePtr create()
void add_item(std::string socket_name, SocketLinkOperation::LinkSocketFn fn, int weight=0)
const bNodeTree & node_tree() const
const bNodeSocket & other_socket() const
T extract_input(const UString identifier)
const bNode & node() const
void set_output(const UString identifier, T &&value)
void update_and_connect_available_socket(bNode &new_node, UString socket_name)
bNode & add_node(UString idname)
void connect_available_socket(bNode &new_node, UString socket_name)
StructureType structure_type
NodeOperation(Context &context, const bNode &node)
#define storage(slot, qualifiers)
void node_register_type(bNodeType &ntype)
bNodeSocketType * node_socket_type_find_static(int type, int subtype=0)
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 bool node_insert_link(bke::NodeInsertLinkParams ¶ms)
static void node_blend_write(const bNodeTree &, const bNode &node, BlendWriter &writer)
static void node_init(bNodeTree *, bNode *node)
static void node_geo_exec(GeoNodeExecParams params)
static NodeOperation * get_compositor_operation(Context &context, const bNode &node)
static void node_layout_ex(ui::Layout &layout, bContext *C, PointerRNA *node_ptr)
static void node_copy_storage(bNodeTree *, bNode *dst_node, const bNode *src_node)
static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms)
static void node_operators()
NODE_STORAGE_FUNCS(NodeCombineBundle)
static void node_blend_read(bNodeTree &, bNode &node, BlendDataReader &reader)
static void node_declare(NodeDeclarationBuilder &b)
static void node_register()
static void node_free_storage(bNode *node)
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)
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 sync_sockets_combine_bundle(SpaceNode &snode, bNode &combine_bundle_node, ReportList *reports, const bNodeSocket *src_bundle_socket)
std::shared_ptr< const FlatBundleType > FlatBundleTypePtr
std::optional< StringRefNull > combine_bundle_node_type(const bNodeTree &tree, const bNode &node)
ImplicitSharingPtr< Bundle > BundlePtr
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
SpaceNode * CTX_wm_space_node(const bContext *C)
void BLO_read_string(BlendDataReader *reader, char **ptr_p)
void common_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
void write_string(const char *data)
NodeSocketInterfaceStructureType structure_type
eNodeSocketDatatype socket_type
struct bNodeTree * edittree
bke::bNodeSocketType * typeinfo
const SocketValueVariant * geometry_nodes_default_value
NodeBlendWriteFunction blend_write_storage_content
void(*) register_operators()
std::string ui_description
NodeBlendDataReadFunction blend_data_read_storage_content
NodeGetCompositorOperationFunction get_compositor_operation
NodeGeometryExecFunction geometry_node_execute
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 StructRNA ** item_srna
static void blend_write_item(BlendWriter *writer, const ItemT &item)
static void blend_read_data_item(BlendDataReader *reader, ItemT &item)
static bool supports_socket_type(const eNodeSocketDatatype socket_type, const int ntree_type)
static std::string validate_name(const StringRef name)
NodeCombineBundleItem ItemT
static std::string socket_identifier_for_item(const ItemT &item)
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)