93 params.socket.typeinfo->idname,
96 socket_iface->init_from_socket_instance(&
params.socket);
97 params.node_tree.tree_interface.active_item_set(&socket_iface->
item);
99 bNode &group_input =
params.add_node(
"NodeGroupInput");
109 if (new_group_input_socket) {
123 socket->
flag &= ~SOCK_HIDDEN;
139 bNode &group_input =
params.add_node(
"NodeGroupInput");
146 if (socket !=
nullptr) {
147 socket->
flag &= ~SOCK_HIDDEN;
172 &asset_data, in_out ==
SOCK_IN ?
"inputs" :
"outputs");
180 const char *socket_idname =
IDP_String(socket_property);
182 if (socket_type ==
nullptr) {
193 if (!socket_names.
add(socket_property->name)) {
199 const StringRef socket_name = socket_property->name;
210 node.
id = &group->id;
215 node.flag &= ~NODE_OPTIONS;
216 node.width = group->default_group_node_width;
222 node, in_out, socket_property->name);
223 if (new_node_socket !=
nullptr) {
266 const char *disabled_hint;
267 if (node_type->poll && !node_type->poll(node_type, &
node_tree, &disabled_hint)) {
270 if (node_type->add_ui_poll && !node_type->add_ui_poll(&C)) {
276 if (node_type->gather_link_search_ops) {
278 *node_type, snode,
node_tree, socket, search_link_ops};
279 node_type->gather_link_search_ops(
params);
304 if (
node_tree.typeinfo->validate_link && !
node_tree.typeinfo->validate_link(from, to)) {
309 (interface_socket.
name ? interface_socket.
name :
""),
337 search.
add(op.name, &op, op.weight);
342 const char *
string = is_first ?
"" :
str;
359 if (item ==
nullptr) {
Main runtime representation of an asset.
IDProperty * BKE_asset_metadata_idprop_find(const AssetMetaData *asset_data, const char *name) ATTR_WARN_UNUSED_RESULT
SpaceNode * CTX_wm_space_node(const bContext *C)
Main * CTX_data_main(const bContext *C)
#define NODE_TYPES_BEGIN(ntype)
void BKE_ntree_update_tag_node_property(bNodeTree *ntree, bNode *node)
#define LISTBASE_FOREACH(type, var, list)
#define SET_FLAG_FROM_TEST(value, test, flag)
void DEG_relations_tag_update(Main *bmain)
NodeTreeInterfaceSocketFlag
@ NODE_INTERFACE_SOCKET_OUTPUT
@ NODE_INTERFACE_SOCKET_INPUT
void ED_node_tree_propagate_change(const bContext *C, Main *bmain, bNodeTree *ntree)
void UI_block_theme_style_set(uiBlock *block, char theme_style)
@ UI_BLOCK_MOVEMOUSE_QUIT
void UI_block_bounds_set_popup(uiBlock *block, int addval, const int bounds_offset[2])
uiBut * uiDefBut(uiBlock *block, int type, int retval, blender::StringRef str, int x, int y, short width, short height, void *poin, float min, float max, const char *tip)
void UI_but_func_search_set(uiBut *but, uiButSearchCreateFn search_create_fn, uiButSearchUpdateFn search_update_fn, void *arg, bool free_arg, uiFreeArgFunc search_arg_free_fn, uiButHandleFunc search_exec_fn, void *active)
bool UI_search_item_add(uiSearchItems *items, const char *name, void *poin, int iconid, int but_flag, uint8_t name_prefix_offset)
void UI_popup_block_invoke_ex(bContext *C, uiBlockCreateFunc func, void *arg, uiFreeArgFunc arg_free, bool can_refresh)
uiBlock * UI_block_begin(const bContext *C, ARegion *region, std::string name, eUIEmbossType emboss)
int UI_searchbox_size_x()
int UI_searchbox_size_y()
uiBut * uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxncpy, int x, int y, short width, short height, const char *tip)
@ UI_BLOCK_THEME_STYLE_POPUP
void UI_but_func_search_set_sep_string(uiBut *but, const char *search_sep_string)
void UI_but_func_search_set_listen(uiBut *but, uiButSearchListenFn listen_fn)
void UI_block_flag_enable(uiBlock *block, int flag)
void UI_but_flag_enable(uiBut *but, int flag)
@ UI_BUT_ACTIVATE_ON_INIT
#define ND_ASSET_LIST_READING
constexpr bool endswith(StringRef suffix) const
void append(const T &value)
AssetMetaData & get_metadata() const
StringRefNull get_name() const
void add(const StringRef str, T *user_data, const int weight=0)
AssetLibraryReference all_library_reference()
void node_set_active(bNodeTree *ntree, bNode *node)
bNodeLink * node_add_link(bNodeTree *ntree, bNode *fromnode, bNodeSocket *fromsock, bNode *tonode, bNodeSocket *tosock)
bNodeSocketType * node_socket_type_find(const char *idname)
bool node_set_selected(bNode *node, bool select)
bNodeSocket * node_find_enabled_socket(bNode &node, eNodeSocketInOut in_out, StringRef name)
void node_socket_move_default_value(Main &bmain, bNodeTree &tree, bNodeSocket &src, bNodeSocket &dst)
bNodeSocket * node_find_socket(bNode *node, eNodeSocketInOut in_out, StringRef identifier)
void storage_fetch(const AssetLibraryReference *library_reference, const bContext *C)
void iterate(const AssetLibraryReference &library_reference, AssetListHandleIterFn fn, FunctionRef< bool(asset_system::AssetRepresentation &)> prefilter_fn=nullptr)
ID * asset_local_id_ensure_imported(Main &bmain, const asset_system::AssetRepresentation &asset)
bool filter_matches_asset(const AssetFilterSettings *filter, const blender::asset_system::AssetRepresentation &asset)
void invoke_node_link_drag_add_menu(bContext &C, bNode &node, bNodeSocket &socket, const float2 &cursor)
bool node_deselect_all(bNodeTree &node_tree)
static void add_reroute_node_fn(nodes::LinkSearchOpParams ¶ms)
static void link_drag_search_update_fn(const bContext *C, void *arg, const char *str, uiSearchItems *items, const bool is_first)
static void link_drag_search_free_fn(void *arg)
static void gather_search_link_ops_for_all_assets(const bContext &C, const bNodeTree &node_tree, const bNodeSocket &socket, Vector< SocketLinkOperation > &search_link_ops)
static void add_existing_group_input_fn(nodes::LinkSearchOpParams ¶ms, const bNodeTreeInterfaceSocket &interface_socket)
static void add_group_input_node_fn(nodes::LinkSearchOpParams ¶ms)
static void link_drag_search_listen_fn(const wmRegionListenerParams *params, void *arg)
static void link_drag_search_exec_fn(bContext *C, void *arg1, void *arg2)
static uiBlock * create_search_popup_block(bContext *C, ARegion *region, void *arg_op)
static void gather_socket_link_operations(const bContext &C, bNodeTree &node_tree, const bNodeSocket &socket, Vector< SocketLinkOperation > &search_link_ops)
static void search_link_ops_for_asset_metadata(const bNodeTree &node_tree, const bNodeSocket &socket, const asset_system::AssetRepresentation &asset, Vector< SocketLinkOperation > &search_link_ops)
void update_node_declaration_and_sockets(bNodeTree &ntree, bNode &node)
#define UI_MENU_ARROW_SEP
struct bNodeTree * edittree
bNodeSocketTypeHandle * typeinfo
bNodeTreeInterfaceItem item
bool(* validate_link)(eNodeSocketDatatype from, eNodeSocketDatatype to)
Vector< SocketLinkOperation > search_link_ops
eNodeSocketInOut in_out() const
bNodeSocket & from_socket
int WM_operator_name_call_ptr(bContext *C, wmOperatorType *ot, wmOperatorCallContext context, PointerRNA *properties, const wmEvent *event)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot)
void WM_operator_properties_free(PointerRNA *ptr)