diff options
author | Jacques Lucke <jacques@blender.org> | 2022-11-11 13:48:56 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-11-11 13:48:56 +0300 |
commit | 57dd1b7799e7453e34c3a503333d0eadfa87af17 (patch) | |
tree | adce5313453c5c3aafdf687dd31862bb0d888bf5 /source/blender/blenkernel/BKE_node.h | |
parent | 84c66fe9db932b82ebf445a63dfb629fb3c1b35c (diff) |
Fix T102386: crash when trying to link sockets from different node trees
This was caused by rBc39eb09ae587e1d9. The optimization broke the case
when the socket is not in the provided node tree. Now there are two separate
functions, one that always does the slow check to see of the socket is really
in the node tree and a potentially much faster version when we are sure
that the socket is in the tree.
Diffstat (limited to 'source/blender/blenkernel/BKE_node.h')
-rw-r--r-- | source/blender/blenkernel/BKE_node.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 6eb9650348a..4e2fc55a222 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -746,7 +746,14 @@ struct bNode *nodeFindNodebyName(struct bNodeTree *ntree, const char *name); /** * Finds a node based on given socket and returns true on success. */ -bool nodeFindNode(struct bNodeTree *ntree, +bool nodeFindNodeTry(struct bNodeTree *ntree, + struct bNodeSocket *sock, + struct bNode **r_node, + int *r_sockindex); +/** + * Same as above but expects that the socket definitely is in the node tree. + */ +void nodeFindNode(struct bNodeTree *ntree, struct bNodeSocket *sock, struct bNode **r_node, int *r_sockindex); |