Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/node_relationships.c
| Show First 20 Lines • Show All 245 Lines • ▼ Show 20 Lines | for (sock = node->outputs.first; sock; sock = sock->next) { | ||||
| } | } | ||||
| /* check for same types */ | /* check for same types */ | ||||
| if (sock->type == sock_target->type) { | if (sock->type == sock_target->type) { | ||||
| return sock; | return sock; | ||||
| } | } | ||||
| } | } | ||||
| /* Always allow linking to an reroute node. The socket type of the reroute sockets might change | |||||
| * after the link has been created. */ | |||||
| if (node->type == NODE_REROUTE) { | |||||
| return node->outputs.first; | |||||
| } | |||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| /* this is a bit complicated, but designed to prioritize finding | /* this is a bit complicated, but designed to prioritize finding | ||||
| * sockets of higher types, such as image, first */ | * sockets of higher types, such as image, first */ | ||||
| static bNodeSocket *best_socket_input(bNodeTree *ntree, bNode *node, int num, int replace) | static bNodeSocket *best_socket_input(bNodeTree *ntree, bNode *node, int num, int replace) | ||||
| { | { | ||||
| bNodeSocket *sock; | bNodeSocket *sock; | ||||
| ▲ Show 20 Lines • Show All 1,709 Lines • Show Last 20 Lines | |||||