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:
authorAlexander Gavrilov <angavrilov@gmail.com>2020-07-27 15:03:23 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2020-08-04 11:29:16 +0300
commit9306037ed3d14a7afce607738f83c8b9968d478d (patch)
tree6a0855906983fa33367060ef540ad611c1a83382 /source/blender/nodes/intern/node_common.c
parentb016e7f258a5be68af56574f185dd4acd08d9af5 (diff)
Node Groups: expose the SOCK_HIDE_VALUE flag for node group inputs.
This flag specifies that even when the socket is not connected, the node should not display the input field for the constant input value. This is useful for inputs like Normal, which have special handling for the missing input case and don't use a constant value. Currently there is no way to change this flag from Python, and through UI it can only be done by re-creating the socket. This patch exposes the flag through RNA and UI, makes sure it is properly updated when changed, and adds special handling to ensure that it is correctly set when creating a node group from a node set that includes reroute nodes. Differential Revision: https://developer.blender.org/D8395
Diffstat (limited to 'source/blender/nodes/intern/node_common.c')
-rw-r--r--source/blender/nodes/intern/node_common.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/nodes/intern/node_common.c b/source/blender/nodes/intern/node_common.c
index 996fb93eb76..439e41b963b 100644
--- a/source/blender/nodes/intern/node_common.c
+++ b/source/blender/nodes/intern/node_common.c
@@ -132,6 +132,9 @@ static bNodeSocket *group_verify_socket(
if (sock) {
strcpy(sock->name, iosock->name);
+ const int mask = SOCK_HIDE_VALUE;
+ sock->flag = (sock->flag & ~mask) | (iosock->flag & mask);
+
if (iosock->typeinfo->interface_verify_socket) {
iosock->typeinfo->interface_verify_socket(ntree, iosock, gnode, sock, "interface");
}