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:
authorRobin Allen <roblovski@gmail.com>2009-08-18 18:31:13 +0400
committerRobin Allen <roblovski@gmail.com>2009-08-18 18:31:13 +0400
commit3803a3c5a7c063718c6cdbdb025143ff93b2d5bb (patch)
treefe9d93951ab25800f76b4413579a0250ad6742ca /source/blender/nodes/intern/TEX_nodes
parent990dcd0f7f362828eddeaca191640c1680808a6c (diff)
Fixed some redraw problems with texture nodes.
Diffstat (limited to 'source/blender/nodes/intern/TEX_nodes')
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_output.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_output.c b/source/blender/nodes/intern/TEX_nodes/TEX_output.c
index 96ee5d74f66..7ce5ec88c48 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_output.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_output.c
@@ -152,6 +152,26 @@ static void unique_name(bNode *node)
}
}
+static void assign_index(struct bNode *node)
+{
+ bNode *tnode;
+ int index = 1;
+
+ tnode = node;
+ while(tnode->prev)
+ tnode = tnode->prev;
+
+ check_index:
+ for(; tnode; tnode= tnode->next)
+ if(tnode->type == TEX_NODE_OUTPUT && tnode != node)
+ if(tnode->custom1 == index) {
+ index ++;
+ goto check_index;
+ }
+
+ node->custom1 = index;
+}
+
static void init(bNode *node)
{
TexNodeOutput *tno = MEM_callocN(sizeof(TexNodeOutput), "TEX_output");
@@ -159,17 +179,16 @@ static void init(bNode *node)
strcpy(tno->name, "Default");
unique_name(node);
- ntreeTexAssignIndex(0, node);
+ assign_index(node);
}
static void copy(bNode *orig, bNode *new)
{
node_copy_standard_storage(orig, new);
unique_name(new);
- ntreeTexAssignIndex(0, new);
+ assign_index(new);
}
-
bNodeType tex_node_output= {
/* *next,*prev */ NULL, NULL,
/* type code */ TEX_NODE_OUTPUT,