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:
authorLukas Tönne <lukas.toenne@gmail.com>2014-03-02 19:04:25 +0400
committerLukas Tönne <lukas.toenne@gmail.com>2014-03-02 19:04:25 +0400
commitfd553c5b7bdfd5bec1cc005bc67785c54916a64a (patch)
tree35dc06e8085b1ede7208fc545f9919426583e217 /source/blender/makesdna
parent6137ae29c110c755e7892d28bf7052fb319aa746 (diff)
Fix T37334: Better "internal links" function for muting and node disconnect.
Implements a more flexible internal connect function for standard nodes (compositor, shader, texture). Allow feasible datatype connections by priority. The priorities for common datatypes in compositor, shader and texture nodes are encoded in a simple function. Certain impossible connections (e.g. color -> cycles shader) are excluded by giving them -1 priority. Priority overrides link status: If a higher priority input can be found, this will be used regardless of link status. Link status only comes into play for inputs with same priority. Reviewers: brecht CC: sebastian_k Differential Revision: https://developer.blender.org/D356
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_node_types.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 4f7c49a0ca3..c21cdfa66a2 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -128,19 +128,23 @@ typedef struct bNodeSocket {
/* XXX deprecated, socket input values are stored in default_value now. kept for forward compatibility */
bNodeStack ns DNA_DEPRECATED; /* custom data for inputs, only UI writes in this */
+
+ /* optional: allowed inputs for internal links */
+ const bool *internal_links;
} bNodeSocket;
/* sock->type */
-#define SOCK_CUSTOM -1 /* socket has no integer type */
-#define SOCK_FLOAT 0
-#define SOCK_VECTOR 1
-#define SOCK_RGBA 2
-#define SOCK_SHADER 3
-#define SOCK_BOOLEAN 4
-#define __SOCK_MESH 5 /* deprecated */
-#define SOCK_INT 6
-#define SOCK_STRING 7
-#define NUM_SOCKET_TYPES 8 /* must be last! */
+typedef enum eNodeSocketDatatype {
+ SOCK_CUSTOM = -1, /* socket has no integer type */
+ SOCK_FLOAT = 0,
+ SOCK_VECTOR = 1,
+ SOCK_RGBA = 2,
+ SOCK_SHADER = 3,
+ SOCK_BOOLEAN = 4,
+ __SOCK_MESH = 5, /* deprecated */
+ SOCK_INT = 6,
+ SOCK_STRING = 7
+} eNodeSocketDatatype;
/* socket side (input/output) */
typedef enum eNodeSocketInOut {