Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/node_relationships.cc
| Show First 20 Lines • Show All 2,110 Lines • ▼ Show 20 Lines | |||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Node Insert Offset Operator | /** \name Node Insert Offset Operator | ||||
| * \{ */ | * \{ */ | ||||
| static int get_main_socket_priority(const bNodeSocket *socket) | static int get_main_socket_priority(const bNodeSocket *socket) | ||||
| { | { | ||||
| switch ((eNodeSocketDatatype)socket->type) { | switch ((eNodeSocketDatatype)socket->type) { | ||||
| case __SOCK_MESH: | case __SOCK_MESH: | ||||
| case SOCK_CUSTOM: | |||||
| return -1; | return -1; | ||||
| case SOCK_BOOLEAN: | case SOCK_CUSTOM: | ||||
| return 0; | return 0; | ||||
| case SOCK_INT: | case SOCK_BOOLEAN: | ||||
| return 1; | return 1; | ||||
| case SOCK_FLOAT: | case SOCK_INT: | ||||
| return 2; | return 2; | ||||
| case SOCK_VECTOR: | case SOCK_FLOAT: | ||||
| return 3; | return 3; | ||||
| case SOCK_RGBA: | case SOCK_VECTOR: | ||||
| return 4; | return 4; | ||||
| case SOCK_RGBA: | |||||
| return 5; | |||||
| case SOCK_STRING: | case SOCK_STRING: | ||||
| case SOCK_SHADER: | case SOCK_SHADER: | ||||
| case SOCK_OBJECT: | case SOCK_OBJECT: | ||||
| case SOCK_IMAGE: | case SOCK_IMAGE: | ||||
| case SOCK_GEOMETRY: | case SOCK_GEOMETRY: | ||||
| case SOCK_COLLECTION: | case SOCK_COLLECTION: | ||||
| case SOCK_TEXTURE: | case SOCK_TEXTURE: | ||||
| case SOCK_MATERIAL: | case SOCK_MATERIAL: | ||||
| return 5; | return 6; | ||||
| } | } | ||||
| return -1; | return -1; | ||||
| } | } | ||||
| /** Get the "main" socket based on the node declaration or an heuristic. */ | /** Get the "main" socket based on the node declaration or an heuristic. */ | ||||
| static bNodeSocket *get_main_socket(bNodeTree &ntree, bNode &node, eNodeSocketInOut in_out) | static bNodeSocket *get_main_socket(bNodeTree &ntree, bNode &node, eNodeSocketInOut in_out) | ||||
| { | { | ||||
| using namespace blender; | using namespace blender; | ||||
| ▲ Show 20 Lines • Show All 438 Lines • Show Last 20 Lines | |||||