diff options
author | Wannes Malfait <Wannes> | 2021-08-10 01:30:44 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-08-10 01:30:44 +0300 |
commit | cd692c6954629e977250ec7c12509ffd3f90bd07 (patch) | |
tree | e202963e9dafa7982c8171674fc79588f5208870 /source/blender/editors/space_node/drawnode.cc | |
parent | 3b87fd376adb599877740ca52ee8098622ba56fb (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/drawnode.cc')
-rw-r--r-- | source/blender/editors/space_node/drawnode.cc | 22 |
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: { |