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:
Diffstat (limited to 'source/blender/editors/space_node/node_templates.cc')
-rw-r--r--source/blender/editors/space_node/node_templates.cc37
1 files changed, 31 insertions, 6 deletions
diff --git a/source/blender/editors/space_node/node_templates.cc b/source/blender/editors/space_node/node_templates.cc
index 492237477c1..74c0d2124cd 100644
--- a/source/blender/editors/space_node/node_templates.cc
+++ b/source/blender/editors/space_node/node_templates.cc
@@ -381,17 +381,42 @@ static Vector<NodeLinkItem> ui_node_link_items(NodeLinkArg *arg,
const SocketDeclaration &socket_decl = *socket_decl_ptr;
NodeLinkItem item;
item.socket_index = index++;
- /* A socket declaration does not necessarily map to exactly one built-in socket type. So only
- * check for the types that matter here. */
- if (dynamic_cast<const decl::Color *>(&socket_decl)) {
- item.socket_type = SOCK_RGBA;
- }
- else if (dynamic_cast<const decl::Float *>(&socket_decl)) {
+ if (dynamic_cast<const decl::Float *>(&socket_decl)) {
item.socket_type = SOCK_FLOAT;
}
+ else if (dynamic_cast<const decl::Int *>(&socket_decl)) {
+ item.socket_type = SOCK_INT;
+ }
+ else if (dynamic_cast<const decl::Bool *>(&socket_decl)) {
+ item.socket_type = SOCK_BOOLEAN;
+ }
else if (dynamic_cast<const decl::Vector *>(&socket_decl)) {
item.socket_type = SOCK_VECTOR;
}
+ else if (dynamic_cast<const decl::Color *>(&socket_decl)) {
+ item.socket_type = SOCK_RGBA;
+ }
+ else if (dynamic_cast<const decl::String *>(&socket_decl)) {
+ item.socket_type = SOCK_STRING;
+ }
+ else if (dynamic_cast<const decl::Image *>(&socket_decl)) {
+ item.socket_type = SOCK_IMAGE;
+ }
+ else if (dynamic_cast<const decl::Texture *>(&socket_decl)) {
+ item.socket_type = SOCK_TEXTURE;
+ }
+ else if (dynamic_cast<const decl::Material *>(&socket_decl)) {
+ item.socket_type = SOCK_MATERIAL;
+ }
+ else if (dynamic_cast<const decl::Shader *>(&socket_decl)) {
+ item.socket_type = SOCK_SHADER;
+ }
+ else if (dynamic_cast<const decl::Collection *>(&socket_decl)) {
+ item.socket_type = SOCK_COLLECTION;
+ }
+ else if (dynamic_cast<const decl::Object *>(&socket_decl)) {
+ item.socket_type = SOCK_OBJECT;
+ }
else {
item.socket_type = SOCK_CUSTOM;
}