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:
authorWannes Malfait <Wannes>2021-08-10 01:30:44 +0300
committerHans Goudey <h.goudey@me.com>2021-08-10 01:30:44 +0300
commitcd692c6954629e977250ec7c12509ffd3f90bd07 (patch)
treee202963e9dafa7982c8171674fc79588f5208870 /source/blender/editors/space_node
parent3b87fd376adb599877740ca52ee8098622ba56fb (diff)
Geometry Nodes: Add labels for switch node texture sockets
This makes texture sockets have a label by default. This can be changed by adding the SOCK_HIDE_LABEL flag to the socket. With this change the switch node now shows the labels "True" and "False" like for the other types of sockets.
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r--source/blender/editors/space_node/drawnode.cc22
1 files changed, 20 insertions, 2 deletions
diff --git a/source/blender/editors/space_node/drawnode.cc b/source/blender/editors/space_node/drawnode.cc
index 95eb1ccc025..b5acdede81b 100644
--- a/source/blender/editors/space_node/drawnode.cc
+++ b/source/blender/editors/space_node/drawnode.cc
@@ -3596,8 +3596,26 @@ static void std_node_socket_draw(
break;
}
case SOCK_TEXTURE: {
- uiTemplateID(
- layout, C, ptr, "default_value", "texture.new", nullptr, nullptr, 0, ICON_NONE, nullptr);
+ if (text == "") {
+ uiTemplateID(layout,
+ C,
+ ptr,
+ "default_value",
+ "texture.new",
+ nullptr,
+ nullptr,
+ 0,
+ ICON_NONE,
+ nullptr);
+ }
+ else {
+ /* 0.3 split ratio is inconsistent, but use it here because the "New" button is large. */
+ uiLayout *row = uiLayoutSplit(layout, 0.3f, false);
+ uiItemL(row, text, 0);
+ uiTemplateID(
+ row, C, ptr, "default_value", "texture.new", nullptr, nullptr, 0, ICON_NONE, nullptr);
+ }
+
break;
}
case SOCK_MATERIAL: {