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.
This commit is contained in:
parent
3b87fd376a
commit
cd692c6954
Notes:
blender-bot
2023-02-14 09:48:25 +01:00
Referenced by commitd9930cddfd
, Fix invalid string comparison incd692c6954
|
@ -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: {
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
static bNodeSocketTemplate geo_node_attribute_sample_texture_in[] = {
|
||||
{SOCK_GEOMETRY, N_("Geometry")},
|
||||
{SOCK_TEXTURE, N_("Texture")},
|
||||
{SOCK_TEXTURE, N_("Texture"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, PROP_NONE, SOCK_HIDE_LABEL},
|
||||
{SOCK_STRING, N_("Mapping")},
|
||||
{SOCK_STRING, N_("Result")},
|
||||
{-1, ""},
|
||||
|
|
Loading…
Reference in New Issue