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 Toenne <lukas.toenne@googlemail.com>2011-03-02 17:13:05 +0300
committerLukas Toenne <lukas.toenne@googlemail.com>2011-03-02 17:13:05 +0300
commit44534392543db63a49d65f619bd5995c18e367da (patch)
tree67008d67b8519cdc7248b62c428dbcb21e501944
parent361b8017d2a6dde23b18b04dc6fe4c51daec1310 (diff)
Removed tests for existing node pointers in RNA function for new links. Group node sockets don't have any specific node they belong to, so no node pointers are found.
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index eadb692d669..4926c695d21 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -601,15 +601,14 @@ static void rna_NodeTree_node_remove(bNodeTree *ntree, ReportList *reports, bNod
static bNodeLink *rna_NodeTree_link_new(bNodeTree *ntree, ReportList *reports, bNodeSocket *in, bNodeSocket *out)
{
bNodeLink *ret;
- bNode *fromnode, *tonode;
+ bNode *fromnode= NULL, *tonode= NULL;
+ int from_in_out, to_in_out;
- if (!nodeFindNode(ntree, in, &fromnode, NULL, NULL)) {
- BKE_reportf(reports, RPT_ERROR, "Unable to locate input socket's node in nodetree");
- return NULL;
- }
-
- if (!nodeFindNode(ntree, out, &tonode, NULL, NULL)) {
- BKE_reportf(reports, RPT_ERROR, "Unable to locate output socket's node in nodetree");
+ nodeFindNode(ntree, in, &fromnode, NULL, &from_in_out);
+ nodeFindNode(ntree, out, &tonode, NULL, &to_in_out);
+
+ if (&from_in_out == &to_in_out) {
+ BKE_reportf(reports, RPT_ERROR, "Same input/output direction of sockets");
return NULL;
}