95 params.socket.typeinfo->idname,
97 params.node_tree.tree_interface.active_item_set(&socket_iface->
item);
99 bNode &group_input =
params.add_node(
"NodeGroupInput");
106 if (node->is_group_input()) {
109 if (new_group_input_socket) {
139 bNode &group_input =
params.add_node(
"NodeGroupInput");
146 if (socket !=
nullptr) {
164 if (tree_type ==
nullptr ||
IDP_int_get(tree_type) != node_tree.
type) {
172 &asset_data, in_out ==
SOCK_IN ?
"inputs" :
"outputs");
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;
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);
305 if (node_tree.
typeinfo->validate_link && !node_tree.
typeinfo->validate_link(from, to)) {
310 (interface_socket.
name ? interface_socket.
name :
""),
343 const char *
string = is_first ?
"" :
str;
355 for (
const bNodeLink *link : socket.directly_linked_links()) {
356 if (new_nodes.
contains(link->fromnode)) {
357 return link->fromnode;
359 if (new_nodes.
contains(link->tonode)) {
373 if (item ==
nullptr) {
392 node_tree.ensure_topology_cache();
394 link_offset -= new_directly_linked_node->location;
396 link_offset.x -= new_directly_linked_node->width;
400 const float2 offset_in_tree = cursor_offset + link_offset;
401 for (
bNode *new_node : new_nodes) {
403 new_node->location[0] += offset_in_tree.x;
404 new_node->location[1] += offset_in_tree.y;
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 IDP_int_get(prop)
#define IDP_string_get(prop)
void BKE_main_ensure_invariants(Main &bmain, std::optional< blender::Span< ID * > > modified_ids=std::nullopt)
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
@ UI_BLOCK_MOVEMOUSE_QUIT
void UI_block_theme_style_set(uiBlock *block, char theme_style)
uiBlock * UI_block_begin(const bContext *C, ARegion *region, std::string name, blender::ui::EmbossType emboss)
@ UI_BUT_ACTIVATE_ON_INIT
void UI_block_bounds_set_popup(uiBlock *block, int addval, const int bounds_offset[2])
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)
void UI_popup_block_invoke_ex(bContext *C, uiBlockCreateFunc func, void *arg, uiFreeArgFunc arg_free, bool can_refresh)
uiBut * uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxncpy, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
int UI_searchbox_size_x()
bool UI_search_item_add(uiSearchItems *items, blender::StringRef name, void *poin, int iconid, int but_flag, uint8_t name_prefix_offset)
int UI_searchbox_size_y()
void UI_but_func_search_set_sep_string(uiBut *but, const char *search_sep_string)
@ UI_BLOCK_THEME_STYLE_POPUP
void UI_but_func_search_set_listen(uiBut *but, uiButSearchListenFn listen_fn)
void UI_block_flag_enable(uiBlock *block, int flag)
uiBut * uiDefBut(uiBlock *block, uiButTypeWithPointerType but_and_ptr_type, int retval, blender::StringRef str, int x, int y, short width, short height, void *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_but_flag_enable(uiBut *but, int flag)
#define ND_ASSET_LIST_READING
constexpr bool contains(const T &value) const
constexpr bool endswith(StringRef suffix) const
void append(const T &value)
void add(const StringRef str, T *user_data, const int weight=0)
Vector< T * > query(const StringRef query) const
AssetLibraryReference all_library_reference()
bNodeTreeInterfaceSocket * add_interface_socket_from_node(bNodeTree &ntree, const bNode &from_node, const bNodeSocket &from_sock, StringRef socket_type, StringRef name)
bNodeSocket * node_find_socket(bNode &node, eNodeSocketInOut in_out, StringRef identifier)
Span< bNodeType * > node_types_get()
bool node_set_selected(bNode &node, bool select)
bNodeSocketType * node_socket_type_find(StringRef idname)
bNodeLink & node_add_link(bNodeTree &ntree, bNode &fromnode, bNodeSocket &fromsock, bNode &tonode, bNodeSocket &tosock)
bNodeSocket * node_find_enabled_socket(bNode &node, eNodeSocketInOut in_out, StringRef name)
void node_set_active(bNodeTree &ntree, bNode &node)
void node_socket_move_default_value(Main &bmain, bNodeTree &tree, bNodeSocket &src, bNodeSocket &dst)
void storage_fetch(const AssetLibraryReference *library_reference, const bContext *C)
void iterate(const AssetLibraryReference &library_reference, AssetListIterFn fn)
bool filter_matches_asset(const AssetFilterSettings *filter, const blender::asset_system::AssetRepresentation &asset)
ID * asset_local_id_ensure_imported(Main &bmain, const asset_system::AssetRepresentation &asset, const std::optional< eAssetImportMethod > import_method=std::nullopt)
void invoke_node_link_drag_add_menu(bContext &C, bNode &node, bNodeSocket &socket, const float2 &cursor)
bool node_deselect_all(bNodeTree &node_tree)
static bNode * get_new_linked_node(bNodeSocket &socket, const Span< bNode * > new_nodes)
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)
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
#define UI_MENU_ARROW_SEP
struct bNodeTree * edittree
bNodeSocketTypeHandle * typeinfo
bNodeTreeInterfaceItem item
int default_group_node_width
bNodeTreeTypeHandle * typeinfo
bNodeTreeInterface tree_interface
bool(* validate_link)(eNodeSocketDatatype from, eNodeSocketDatatype to)
Vector< SocketLinkOperation > search_link_ops
eNodeSocketInOut in_out() const
bNodeSocket & from_socket
wmOperatorStatus WM_operator_name_call_ptr(bContext *C, wmOperatorType *ot, blender::wm::OpCallContext 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)