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:
authorJacques Lucke <jacques@blender.org>2021-05-12 13:41:21 +0300
committerJacques Lucke <jacques@blender.org>2021-05-12 13:41:30 +0300
commit207472930834a2916cf18bbdff51bcd77c6dd0c0 (patch)
tree5081635eefdbb3f04e02f1085aa80557988cf24d /source/blender/editors/space_node/drawnode.c
parenta43a455fdd8b0934faec4db149eff468208f3df6 (diff)
Nodes: add boilerplate for texture and material sockets
The sockets are not exposed in any nodes yet. They work similar to the Object/Collection sockets, which also just reference a data block. This is part of D11222.
Diffstat (limited to 'source/blender/editors/space_node/drawnode.c')
-rw-r--r--source/blender/editors/space_node/drawnode.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index fa89d797076..8f1bfe61ab9 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -3340,6 +3340,8 @@ static const float std_node_socket_colors[][4] = {
{0.89, 0.76, 0.43, 1.0}, /* SOCK_IMAGE */
{0.00, 0.84, 0.64, 1.0}, /* SOCK_GEOMETRY */
{0.96, 0.96, 0.96, 1.0}, /* SOCK_COLLECTION */
+ {0.50, 0.00, 0.00, 1.0}, /* SOCK_TEXTURE, TODO: Choose color. */
+ {0.00, 0.50, 0.00, 1.0}, /* SOCK_MATERIAL, TODO: Choose color. */
};
/* common color callbacks for standard types */
@@ -3480,6 +3482,14 @@ static void std_node_socket_draw(
uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, text, 0);
break;
}
+ case SOCK_TEXTURE: {
+ uiTemplateID(layout, C, ptr, "default_value", "texture.new", NULL, NULL, 0, ICON_NONE, NULL);
+ break;
+ }
+ case SOCK_MATERIAL: {
+ uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, text, 0);
+ break;
+ }
default:
node_socket_button_label(C, layout, ptr, node_ptr, text);
break;