Fix T46106: Hidden socket w/ node link from Py API

Internally this was OK, but an invalid state from the users POV.
This commit is contained in:
Campbell Barton 2015-09-14 20:39:20 +10:00
parent 5611237391
commit 2db71782e7
Notes: blender-bot 2023-02-14 08:40:25 +01:00
Referenced by issue #46106, Creating a link between hidden sockets does not make them visible
1 changed files with 5 additions and 0 deletions

View File

@ -792,6 +792,11 @@ static bNodeLink *rna_NodeTree_link_new(bNodeTree *ntree, ReportList *reports,
ret = nodeAddLink(ntree, fromnode, fromsock, tonode, tosock);
if (ret) {
/* not an issue from the UI, clear hidden from API to keep valid state. */
fromsock->flag &= ~SOCK_HIDDEN;
tosock->flag &= ~SOCK_HIDDEN;
if (tonode)
nodeUpdate(ntree, tonode);