Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2022-01-12 18:49:49 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2022-01-14 18:30:59 +0300
commit85df7036f76b87102466079cc46c2bbfb9b17d9c (patch)
tree46eeffc71e485416c5b4ebe6eb30ea071f81681d /source/blender/nodes/intern/node_common.cc
parente57365a70b697d534a13a4a5e62547be3cd91435 (diff)
Fix T94827: Group Input/Output cannot connect to custom sockets
Caused by rBa5c59fb90ef9. Since Group Input and Output sockets happen to be of type `SOCK_CUSTOM` [and since rBa5c59fb90ef9 custom py defined sockets are too :)] a check introduced in rB513066e8ad6f that prevents connections for `SOCK_CUSTOM` triggered. Now refine the check, so it specifically looks for NODE_GROUP_INPUT / NODE_GROUP_OUTPUT, too (this keeps the intention intact to not connect group inputs to group outputs and vice versa, but allows custom py defined sockets to connect again) and put it in new utility function. Maniphest Tasks: T94827 Differential Revision: https://developer.blender.org/D13817
Diffstat (limited to 'source/blender/nodes/intern/node_common.cc')
-rw-r--r--source/blender/nodes/intern/node_common.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/nodes/intern/node_common.cc b/source/blender/nodes/intern/node_common.cc
index 1c9a1730635..21dec8489b4 100644
--- a/source/blender/nodes/intern/node_common.cc
+++ b/source/blender/nodes/intern/node_common.cc
@@ -420,6 +420,11 @@ void BKE_node_tree_unlink_id(ID *id, struct bNodeTree *ntree)
/** \name Node #GROUP_INPUT / #GROUP_OUTPUT
* \{ */
+static bool is_group_extension_socket(const bNode *node, const bNodeSocket *socket)
+{
+ return socket->type == SOCK_CUSTOM && ELEM(node->type, NODE_GROUP_OUTPUT, NODE_GROUP_INPUT);
+}
+
static void node_group_input_init(bNodeTree *ntree, bNode *node)
{
node_group_input_update(ntree, node);
@@ -471,7 +476,7 @@ void node_group_input_update(bNodeTree *ntree, bNode *node)
* This could be improved by choosing the "best" type among all links,
* whatever that means.
*/
- if (link->tosock->type != SOCK_CUSTOM) {
+ if (!is_group_extension_socket(link->tonode, link->tosock)) {
exposelink = link;
break;
}
@@ -568,7 +573,7 @@ void node_group_output_update(bNodeTree *ntree, bNode *node)
* This could be improved by choosing the "best" type among all links,
* whatever that means.
*/
- if (link->fromsock->type != SOCK_CUSTOM) {
+ if (!is_group_extension_socket(link->fromnode, link->fromsock)) {
exposelink = link;
break;
}