diff options
author | Jacques Lucke <jacques@blender.org> | 2021-11-17 13:10:46 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-11-17 13:11:28 +0300 |
commit | c2ab47e7296a5fc7f9814153354567f608d41f00 (patch) | |
tree | b4e4740ee8e1ffa92238daf572ae25f5d6784053 /source/blender/blenkernel | |
parent | 473be239c3c3669643853d549f06723d40b941bb (diff) |
Cleanup: change node socket availability in a single place
This cleans up part of the code that still set the flag manually. Also, this
change helps with D13246 because it makes it easier to tag the node
tree as changed when the availability of a socket changed.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_node.h | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/node.cc | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 645b4410623..8f7f224cf0f 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -731,7 +731,9 @@ void nodeUpdateInternalLinks(struct bNodeTree *ntree, struct bNode *node); int nodeSocketIsHidden(const struct bNodeSocket *sock); void ntreeTagUsedSockets(struct bNodeTree *ntree); -void nodeSetSocketAvailability(struct bNodeSocket *sock, bool is_available); +void nodeSetSocketAvailability(struct bNodeTree *ntree, + struct bNodeSocket *sock, + bool is_available); int nodeSocketLinkLimit(const struct bNodeSocket *sock); diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index 98c31eab7cd..850e3b8072a 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -3992,8 +3992,10 @@ int nodeSocketIsHidden(const bNodeSocket *sock) return ((sock->flag & (SOCK_HIDDEN | SOCK_UNAVAIL)) != 0); } -void nodeSetSocketAvailability(bNodeSocket *sock, bool is_available) +void nodeSetSocketAvailability(bNodeTree *UNUSED(ntree), bNodeSocket *sock, bool is_available) { + /* #ntree is not needed right now, but it's generally necessary when changing the tree because we + * want to tag it as changed in the future. */ if (is_available) { sock->flag &= ~SOCK_UNAVAIL; } |