Fix T37334: Better "internal links" function for muting and node disconnect.
authorLukas Tönne <lukas.toenne@gmail.com>
Sun, 2 Mar 2014 15:04:25 +0000 (16:04 +0100)
committerLukas Tönne <lukas.toenne@gmail.com>
Sun, 2 Mar 2014 15:04:25 +0000 (16:04 +0100)
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

16 files changed:
source/blender/blenkernel/BKE_node.h
source/blender/makesdna/DNA_node_types.h
source/blender/nodes/intern/node_socket.c
source/blender/nodes/intern/node_util.c
source/blender/nodes/shader/nodes/node_shader_tex_brick.c
source/blender/nodes/shader/nodes/node_shader_tex_checker.c
source/blender/nodes/shader/nodes/node_shader_tex_environment.c
source/blender/nodes/shader/nodes/node_shader_tex_gradient.c
source/blender/nodes/shader/nodes/node_shader_tex_image.c
source/blender/nodes/shader/nodes/node_shader_tex_magic.c
source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c
source/blender/nodes/shader/nodes/node_shader_tex_noise.c
source/blender/nodes/shader/nodes/node_shader_tex_sky.c
source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c
source/blender/nodes/shader/nodes/node_shader_tex_wave.c
source/blender/nodes/shader/nodes/node_shader_texture.c

index 59ea921e11e8b34df8fe6b30462453a51de23e99..d37e16e6349405d604e88b947b2e8ff8066ce619 100644 (file)
@@ -101,6 +101,8 @@ typedef struct bNodeSocketTemplate {
        float min, max;
        int subtype;  /* would use PropertySubType but this is a bad level include to use RNA */
        int flag;
+       /* optional: allowed inputs for internal links */
+       const bool *internal_links;
        
        /* after this line is used internal only */
        struct bNodeSocket *sock;               /* used to hold verified socket */
index 4f7c49a0ca39704efe4eacc1e1c5c6a80c781ae8..c21cdfa66a25e3b01665e0e2eeaa191a095ec1d7 100644 (file)
@@ -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 {
index b30658fa2becbd74a1def879abd86ddc8fa2d2e8..b791f6f73936c664c239a067c829c437549ed073 100644 (file)
@@ -56,6 +56,7 @@ struct bNodeSocket *node_add_socket_from_template(struct bNodeTree *ntree, struc
        bNodeSocket *sock = nodeAddStaticSocket(ntree, node, in_out, stemp->type, stemp->subtype, stemp->identifier, stemp->name);
        
        sock->flag |= stemp->flag;
+       sock->internal_links = stemp->internal_links;
        
        /* initialize default_value */
        switch (stemp->type) {
@@ -117,6 +118,7 @@ static bNodeSocket *verify_socket_template(bNodeTree *ntree, bNode *node, int in
                sock->type = stemp->type;
                sock->limit = (stemp->limit == 0 ? 0xFFF : stemp->limit);
                sock->flag |= stemp->flag;
+               sock->internal_links = stemp->internal_links;
                
                BLI_remlink(socklist, sock);
                
index 3997d9cbcacf2d8e8c663bb002d0dd1a7e1fba6a..8fb455cd3197ecaa82e6fc6d07a3f1b067da6376 100644 (file)
@@ -81,6 +81,7 @@ void *node_initexec_curves(bNodeExecContext *UNUSED(context), bNode *node, bNode
        return NULL;  /* unused return */
 }
 
+
 /**** Labels ****/
 
 void node_blend_label(bNodeTree *UNUSED(ntree), bNode *node, char *label, int maxlen)
@@ -111,45 +112,139 @@ void node_filter_label(bNodeTree *UNUSED(ntree), bNode *node, char *label, int m
        BLI_strncpy(label, IFACE_(name), maxlen);
 }
 
+
+/**** Internal Links (mute and disconnect) ****/
+
+/* common datatype priorities, works for compositor, shader and texture nodes alike
+ * defines priority of datatype connection based on output type (to):
+ *   < 0  : never connect these types
+ *   >= 0 : priority of connection (higher values chosen first)
+ */
+static int node_datatype_priority(eNodeSocketDatatype from, eNodeSocketDatatype to)
+{
+       switch (to) {
+               case SOCK_RGBA:
+                       switch (from) {
+                               case SOCK_RGBA:     return 4;
+                               case SOCK_FLOAT:    return 3;
+                               case SOCK_INT:      return 2;
+                               case SOCK_BOOLEAN:  return 1;
+                               default: return -1;
+                       }
+               case SOCK_VECTOR:
+                       switch (from) {
+                               case SOCK_VECTOR:   return 4;
+                               case SOCK_FLOAT:    return 3;
+                               case SOCK_INT:      return 2;
+                               case SOCK_BOOLEAN:  return 1;
+                               default:            return -1;
+                       }
+               case SOCK_FLOAT:
+                       switch (from) {
+                               case SOCK_FLOAT:    return 5;
+                               case SOCK_INT:      return 4;
+                               case SOCK_BOOLEAN:  return 3;
+                               case SOCK_RGBA:     return 2;
+                               case SOCK_VECTOR:   return 1;
+                               default:            return -1;
+                       }
+               case SOCK_INT:
+                       switch (from) {
+                               case SOCK_INT:      return 5;
+                               case SOCK_FLOAT:    return 4;
+                               case SOCK_BOOLEAN:  return 3;
+                               case SOCK_RGBA:     return 2;
+                               case SOCK_VECTOR:   return 1;
+                               default:            return -1;
+                       }
+               case SOCK_BOOLEAN:
+                       switch (from) {
+                               case SOCK_BOOLEAN:  return 5;
+                               case SOCK_INT:      return 4;
+                               case SOCK_FLOAT:    return 3;
+                               case SOCK_RGBA:     return 2;
+                               case SOCK_VECTOR:   return 1;
+                               default:            return -1;
+                       }
+               case SOCK_SHADER:
+                       switch (from) {
+                               case SOCK_SHADER:   return 1;
+                               default:            return -1;
+                       }
+               case SOCK_STRING:
+                       switch (from) {
+                               case SOCK_STRING:   return 1;
+                               default:            return -1;
+                       }
+               default: return -1;
+       }
+}
+
+/* select a suitable input socket for an output */
+static bNodeSocket *select_internal_link_input(bNode *node, bNodeSocket *output)
+{
+       const bool *allowed_inputs = output->internal_links;
+       bNodeSocket *selected = NULL, *input;
+       int i;
+       int sel_priority = -1;
+       bool sel_is_linked = false;
+       
+       for (input = node->inputs.first, i = 0; input; input = input->next, ++i) {
+               int priority = node_datatype_priority(input->type, output->type);
+               bool is_linked = (input->link != NULL);
+               bool preferred;
+               
+               if (nodeSocketIsHidden(input) ||                /* ignore hidden sockets */
+                   (allowed_inputs && !allowed_inputs[i]) ||   /* ignore if input is not allowed */
+                   priority < 0 ||                             /* ignore incompatible types */
+                   (priority < sel_priority))                  /* ignore if we already found a higher priority input */
+                       continue;
+               
+               /* determine if this input is preferred over the currently selected */
+               preferred = (priority > sel_priority) ||    /* prefer higher datatype priority */
+                           (is_linked && !sel_is_linked);  /* prefer linked over unlinked */
+               
+               if (preferred) {
+                       selected = input;
+                       sel_is_linked = is_linked;
+                       sel_priority = priority;
+               }
+       }
+       
+       return selected;
+}
+
 void node_update_internal_links_default(bNodeTree *ntree, bNode *node)
 {
        bNodeLink *link;
-       bNodeSocket *output, *input, *selected;
-
+       bNodeSocket *output, *input;
+       
        /* sanity check */
        if (!ntree)
                return;
-
+       
        /* use link pointer as a tag for handled sockets (for outputs is unused anyway) */
        for (output = node->outputs.first; output; output = output->next)
                output->link = NULL;
        
        for (link = ntree->links.first; link; link = link->next) {
+               if (nodeLinkIsHidden(link))
+                       continue;
+               
                output = link->fromsock;
                if (link->fromnode != node || output->link)
                        continue;
+               if (nodeSocketIsHidden(output))
+                       continue;
                output->link = link; /* not really used, just for tagging handled sockets */
                
                /* look for suitable input */
-               selected = NULL;
-               for (input = node->inputs.first; input; input = input->next) {
-                       /* only use if same type */
-                       if (input->type == output->type) {
-                               if (!selected) {
-                                       selected = input;
-                               }
-                               else {
-                                       /* linked inputs preferred */
-                                       if (input->link && !selected->link)
-                                               selected = input;
-                               }
-                       }
-               }
+               input = select_internal_link_input(node, output);
                
-               if (selected) {
+               if (input) {
                        bNodeLink *ilink = MEM_callocN(sizeof(bNodeLink), "internal node link");
                        ilink->fromnode = node;
-                       ilink->fromsock = selected;
+                       ilink->fromsock = input;
                        ilink->tonode = node;
                        ilink->tosock = output;
                        /* internal link is always valid */
@@ -163,6 +258,9 @@ void node_update_internal_links_default(bNodeTree *ntree, bNode *node)
                output->link = NULL;
 }
 
+
+/**** Default value RNA access ****/
+
 float node_socket_get_float(bNodeTree *ntree, bNode *UNUSED(node), bNodeSocket *sock)
 {
        PointerRNA ptr;
index 8162b5b8a75195228ba0ae00bdf1f859bb298cfc..f75f6a654d1e90128581f24548f0da8548cc36d2 100644 (file)
 /* **************** OUTPUT ******************** */
 
 static bNodeSocketTemplate sh_node_tex_brick_in[] = {
-       {       SOCK_VECTOR, 1, N_("Vector"),           0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE},
+       {       SOCK_VECTOR, 1, N_("Vector"),           0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE | SOCK_NO_INTERNAL_LINK},
        {       SOCK_RGBA, 1,   N_("Color1"),           0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
        {       SOCK_RGBA, 1,   N_("Color2"),           0.2f, 0.2f, 0.2f, 1.0f, 0.0f, 1.0f},
-       {       SOCK_RGBA, 1,   N_("Mortar"),           0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
-       {       SOCK_FLOAT, 1,  N_("Scale"),            5.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f},
-       {       SOCK_FLOAT, 1,  N_("Mortar Size"),      0.02f, 0.0f, 0.0f, 0.0f, 0.0f, 0.125f},
-       {       SOCK_FLOAT, 1,  N_("Bias"),                 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f},
-       {       SOCK_FLOAT, 1,  N_("Brick Width"),      0.5f, 0.0f, 0.0f, 0.0f, 0.01f, 100.0f},
-       {       SOCK_FLOAT, 1,  N_("Row Height"),   0.25f, 0.0f, 0.0f, 0.0f, 0.01f, 100.0f},
+       {       SOCK_RGBA, 1,   N_("Mortar"),           0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE, SOCK_NO_INTERNAL_LINK},
+       {       SOCK_FLOAT, 1,  N_("Scale"),            5.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f, PROP_NONE, SOCK_NO_INTERNAL_LINK},
+       {       SOCK_FLOAT, 1,  N_("Mortar Size"),      0.02f, 0.0f, 0.0f, 0.0f, 0.0f, 0.125f, PROP_NONE, SOCK_NO_INTERNAL_LINK},
+       {       SOCK_FLOAT, 1,  N_("Bias"),                 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, PROP_NONE, SOCK_NO_INTERNAL_LINK},
+       {       SOCK_FLOAT, 1,  N_("Brick Width"),      0.5f, 0.0f, 0.0f, 0.0f, 0.01f, 100.0f, PROP_NONE, SOCK_NO_INTERNAL_LINK},
+       {       SOCK_FLOAT, 1,  N_("Row Height"),   0.25f, 0.0f, 0.0f, 0.0f, 0.01f, 100.0f, PROP_NONE, SOCK_NO_INTERNAL_LINK},
        {       -1, 0, ""       }
 };
 
 static bNodeSocketTemplate sh_node_tex_brick_out[] = {
        {       SOCK_RGBA, 0, N_("Color"),              0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-       {       SOCK_FLOAT, 0, N_("Fac"),               0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
+       {       SOCK_FLOAT, 0, N_("Fac"),               0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR, SOCK_NO_INTERNAL_LINK},
        {       -1, 0, ""       }
 };
 
index fb62d30a787744e88d3af67bb217303c676efbbf..30e51c7cb7d3ac2745366b35090517b8f0476c05 100644 (file)
@@ -33,13 +33,13 @@ static bNodeSocketTemplate sh_node_tex_checker_in[] = {
        {       SOCK_VECTOR, 1, N_("Vector"),           0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE},
        {       SOCK_RGBA, 1,   N_("Color1"),           0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
        {       SOCK_RGBA, 1,   N_("Color2"),           0.2f, 0.2f, 0.2f, 1.0f, 0.0f, 1.0f},
-       {       SOCK_FLOAT, 1,  N_("Scale"),            5.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f},
+       {       SOCK_FLOAT, 1,  N_("Scale"),            5.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f, PROP_NONE, SOCK_NO_INTERNAL_LINK},
        {       -1, 0, ""       }
 };
 
 static bNodeSocketTemplate sh_node_tex_checker_out[] = {
        {       SOCK_RGBA, 0, N_("Color"),              0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-       {       SOCK_FLOAT, 0, N_("Fac"),               0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
+       {       SOCK_FLOAT, 0, N_("Fac"),               0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR, SOCK_NO_INTERNAL_LINK},
        {       -1, 0, ""       }
 };
 
index 5e6471eab77e25e26625b056cc80938579dba9a8..dcb3ef3c8a0eac4c6a89aae2a8e91d6725cb684d 100644 (file)
@@ -37,7 +37,7 @@ static bNodeSocketTemplate sh_node_tex_environment_in[] = {
 };
 
 static bNodeSocketTemplate sh_node_tex_environment_out[] = {
-       {       SOCK_RGBA, 0, N_("Color"),              0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+       {       SOCK_RGBA, 0, N_("Color"),              0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_NO_INTERNAL_LINK},
        {       -1, 0, ""       }
 };
 
index a077e57d3183f197a121efb90f9907fc0aa651a5..e11591ab5ceaced55b497de4d256861bf298b766 100644 (file)
@@ -35,8 +35,8 @@ static bNodeSocketTemplate sh_node_tex_gradient_in[] = {
 };
 
 static bNodeSocketTemplate sh_node_tex_gradient_out[] = {
-       {       SOCK_RGBA, 0, N_("Color"),              0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-       {       SOCK_FLOAT, 0, N_("Fac"),               0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
+       {       SOCK_RGBA, 0, N_("Color"),              0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_NO_INTERNAL_LINK},
+       {       SOCK_FLOAT, 0, N_("Fac"),               0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR, SOCK_NO_INTERNAL_LINK},
        {       -1, 0, ""       }
 };
 
index 1b705e12daf7bb11224faf17597767e94dd4d882..0a11ee4a9b6e4eebccff4a8a76af15c398e92e65 100644 (file)
@@ -37,8 +37,8 @@ static bNodeSocketTemplate sh_node_tex_image_in[] = {
 };
 
 static bNodeSocketTemplate sh_node_tex_image_out[] = {
-       {       SOCK_RGBA, 0, N_("Color"),              0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-       {       SOCK_FLOAT, 0, N_("Alpha"),             0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+       {       SOCK_RGBA, 0, N_("Color"),              0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_NO_INTERNAL_LINK},
+       {       SOCK_FLOAT, 0, N_("Alpha"),             0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_NO_INTERNAL_LINK},
        {       -1, 0, ""       }
 };
 
index dba198f55f40c538270f6f93e6f27756da5c339b..de2daeb8ee18e2422c3d002bd542e9afc1c0cd90 100644 (file)
@@ -37,8 +37,8 @@ static bNodeSocketTemplate sh_node_tex_magic_in[] = {
 };
 
 static bNodeSocketTemplate sh_node_tex_magic_out[] = {
-       {       SOCK_RGBA, 0, N_("Color"),              0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-       {       SOCK_FLOAT, 0, N_("Fac"),               0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
+       {       SOCK_RGBA, 0, N_("Color"),              0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_NO_INTERNAL_LINK},
+       {       SOCK_FLOAT, 0, N_("Fac"),               0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR, SOCK_NO_INTERNAL_LINK},
        {       -1, 0, ""       }
 };
 
index 114fec71578c8b6cfe888a3b8e8b4538e66b9a8b..75566773ea251a07d3d96aa4b4792b379b5876b3 100644 (file)
@@ -41,8 +41,8 @@ static bNodeSocketTemplate sh_node_tex_musgrave_in[] = {
 };
 
 static bNodeSocketTemplate sh_node_tex_musgrave_out[] = {
-       {       SOCK_RGBA, 0, N_("Color"),              0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-       {       SOCK_FLOAT, 0, N_("Fac"),               0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
+       {       SOCK_RGBA, 0, N_("Color"),              0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_NO_INTERNAL_LINK},
+       {       SOCK_FLOAT, 0, N_("Fac"),               0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR, SOCK_NO_INTERNAL_LINK},
        {       -1, 0, ""       }
 };
 
index dfb2aca2169fc253d80d0e741a32d3411548322d..601a31dff00130fc69c5e53e3b0b18c9d5278a85 100644 (file)
@@ -38,8 +38,8 @@ static bNodeSocketTemplate sh_node_tex_noise_in[] = {
 };
 
 static bNodeSocketTemplate sh_node_tex_noise_out[] = {
-       {       SOCK_RGBA, 0, N_("Color"),              0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-       {       SOCK_FLOAT, 0, N_("Fac"),               0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
+       {       SOCK_RGBA, 0, N_("Color"),              0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_NO_INTERNAL_LINK},
+       {       SOCK_FLOAT, 0, N_("Fac"),               0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR, SOCK_NO_INTERNAL_LINK},
        {       -1, 0, ""       }
 };
 
index 22061979b120fcc34985da6caf129b3a1a3b9f25..51cca0df851ce430c764c855738451880e69a159 100644 (file)
@@ -35,7 +35,7 @@ static bNodeSocketTemplate sh_node_tex_sky_in[] = {
 };
 
 static bNodeSocketTemplate sh_node_tex_sky_out[] = {
-       {       SOCK_RGBA, 0, N_("Color"),              0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+       {       SOCK_RGBA, 0, N_("Color"),              0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_NO_INTERNAL_LINK},
        {       -1, 0, ""       }
 };
 
index 3ee9268e198b27c81ddd7ac6798dd3e16422e0da..5eba5f3f59d1698f0cf15e2655d1f1b41c24898e 100644 (file)
@@ -36,8 +36,8 @@ static bNodeSocketTemplate sh_node_tex_voronoi_in[] = {
 };
 
 static bNodeSocketTemplate sh_node_tex_voronoi_out[] = {
-       {       SOCK_RGBA, 0, N_("Color"),              0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-       {       SOCK_FLOAT, 0, N_("Fac"),               0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
+       {       SOCK_RGBA, 0, N_("Color"),              0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_NO_INTERNAL_LINK},
+       {       SOCK_FLOAT, 0, N_("Fac"),               0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR, SOCK_NO_INTERNAL_LINK},
        {       -1, 0, ""       }
 };
 
index e2c73a93b21a9f6604802de01e6d0499fb3ee797..a052817e9aae667b4d75238d2cabcacc1b2fb79a 100644 (file)
@@ -38,9 +38,11 @@ static bNodeSocketTemplate sh_node_tex_wave_in[] = {
        {       -1, 0, ""       }
 };
 
+const bool internal_links[5] = {0,0,0,0,0};
+
 static bNodeSocketTemplate sh_node_tex_wave_out[] = {
-       {       SOCK_RGBA, 0, N_("Color"),              0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-       {       SOCK_FLOAT, 0, N_("Fac"),               0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
+       {       SOCK_RGBA, 0, N_("Color"),              0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, 0, internal_links},
+       {       SOCK_FLOAT, 0, N_("Fac"),               0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR, 0, internal_links},
        {       -1, 0, ""       }
 };
 
index f6cb243059d49e0caf2d38b2164d2c1a419f817a..6f4e56c76a44e1245a1808481094dee1f00196fd 100644 (file)
@@ -42,9 +42,9 @@ static bNodeSocketTemplate sh_node_texture_in[] = {
        {       -1, 0, ""       }
 };
 static bNodeSocketTemplate sh_node_texture_out[] = {
-       {       SOCK_FLOAT, 0, N_("Value")},
-       {       SOCK_RGBA, 0, N_("Color")},
-       {       SOCK_VECTOR, 0, N_("Normal")},
+       {       SOCK_FLOAT, 0, N_("Value"), 0, 0, 0, 0, 0, 0, PROP_NONE, SOCK_NO_INTERNAL_LINK},
+       {       SOCK_RGBA, 0, N_("Color"), 0, 0, 0, 0, 0, 0, PROP_NONE, SOCK_NO_INTERNAL_LINK},
+       {       SOCK_VECTOR, 0, N_("Normal"), 0, 0, 0, 0, 0, 0, PROP_NONE, SOCK_NO_INTERNAL_LINK},
        {       -1, 0, ""       }
 };