diff options
-rw-r--r-- | source/blender/blenkernel/intern/node.cc | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index d3f61d381f2..200eefb73ec 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -1165,6 +1165,9 @@ static void node_set_typeinfo(const struct bContext *C, } } +/* Warning: default_value must either be null or match the typeinfo at this point. + * This function is called both for initializing new sockets and after loading files. + */ static void node_socket_set_typeinfo(bNodeTree *ntree, bNodeSocket *sock, bNodeSocketType *typeinfo) @@ -3286,9 +3289,9 @@ static bNodeSocket *make_socket_interface(bNodeTree *ntree, bNodeSocket *sock = MEM_cnew<bNodeSocket>("socket template"); BLI_strncpy(sock->idname, stype->idname, sizeof(sock->idname)); - node_socket_set_typeinfo(ntree, sock, stype); sock->in_out = in_out; sock->type = SOCK_CUSTOM; /* int type undefined by default */ + node_socket_set_typeinfo(ntree, sock, stype); /* assign new unique index */ const int own_index = ntree->cur_index++; diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 4d68330c84d..eaf2142495e 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -12441,7 +12441,7 @@ static void rna_def_nodetree(BlenderRNA *brna) RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_REGISTER_OPTIONAL); parm = RNA_def_string( func, "idname", "NodeSocket", MAX_NAME, "Socket Type", "Identifier of the socket type"); - RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); + RNA_def_parameter_flags(parm, PROP_NEVER_NULL | PROP_THICK_WRAP, PARM_REQUIRED); RNA_def_function_return(func, RNA_def_boolean(func, "valid", false, "", "")); } |