Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/link_drag_search.cc
| /* SPDX-License-Identifier: GPL-2.0-or-later */ | /* SPDX-License-Identifier: GPL-2.0-or-later */ | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_string_search.h" | #include "BLI_string_search.h" | ||||
| #include "DNA_space_types.h" | #include "DNA_space_types.h" | ||||
| #include "BKE_asset.h" | #include "BKE_asset.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_idprop.h" | #include "BKE_idprop.h" | ||||
| #include "BKE_lib_id.h" | #include "BKE_lib_id.h" | ||||
| #include "BKE_node_runtime.hh" | #include "BKE_node_runtime.hh" | ||||
| #include "BKE_node_tree_update.h" | #include "BKE_node_tree_update.h" | ||||
| #include "BKE_screen.h" | #include "BKE_screen.h" | ||||
| #include "NOD_socket.h" | |||||
| #include "NOD_socket_search_link.hh" | #include "NOD_socket_search_link.hh" | ||||
| #include "BLT_translation.h" | #include "BLT_translation.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| ▲ Show 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | search_link_ops.append( | ||||
| node.flag &= ~NODE_OPTIONS; | node.flag &= ~NODE_OPTIONS; | ||||
| node.id = asset::get_local_id_from_asset_or_append_and_reuse(bmain, asset); | node.id = asset::get_local_id_from_asset_or_append_and_reuse(bmain, asset); | ||||
| id_us_plus(node.id); | id_us_plus(node.id); | ||||
| BKE_ntree_update_tag_node_property(¶ms.node_tree, &node); | BKE_ntree_update_tag_node_property(¶ms.node_tree, &node); | ||||
| DEG_relations_tag_update(&bmain); | DEG_relations_tag_update(&bmain); | ||||
| /* Create the inputs and outputs on the new node. */ | /* Create the inputs and outputs on the new node. */ | ||||
| node.typeinfo->group_update_func(¶ms.node_tree, &node); | nodes::update_node_declaration_and_sockets(params.node_tree, node); | ||||
| bNodeSocket *new_node_socket = bke::node_find_enabled_socket( | bNodeSocket *new_node_socket = bke::node_find_enabled_socket( | ||||
| node, in_out, socket_property->name); | node, in_out, socket_property->name); | ||||
| if (new_node_socket != nullptr) { | if (new_node_socket != nullptr) { | ||||
| /* Rely on the way #nodeAddLink switches in/out if necessary. */ | /* Rely on the way #nodeAddLink switches in/out if necessary. */ | ||||
| nodeAddLink(¶ms.node_tree, ¶ms.node, ¶ms.socket, &node, new_node_socket); | nodeAddLink(¶ms.node_tree, ¶ms.node, ¶ms.socket, &node, new_node_socket); | ||||
| } | } | ||||
| }, | }, | ||||
| ▲ Show 20 Lines • Show All 255 Lines • Show Last 20 Lines | |||||