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:
authorTon Roosendaal <ton@blender.org>2010-12-20 14:08:29 +0300
committerTon Roosendaal <ton@blender.org>2010-12-20 14:08:29 +0300
commit97197b54cf3473e29d3c5626fc30926a236454a1 (patch)
tree33f594d84bce0903d08a6299a54a09df40eb82da /source/blender/blenkernel/intern/node.c
parent57cc3a5f6dc416db97e0849364cdb4b0603e0792 (diff)
Bugfix #25309
Code cleanup to allow switching active output nodes in Compositor made shader nodes output not set correctly. Now you can have multiple output nodes in shaders too, and switch on click-activate.
Diffstat (limited to 'source/blender/blenkernel/intern/node.c')
-rw-r--r--source/blender/blenkernel/intern/node.c45
1 files changed, 28 insertions, 17 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 663a2d8844c..f52a538cc00 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -1705,21 +1705,22 @@ static void ntreeSetOutput(bNodeTree *ntree)
{
bNode *node;
- if(ntree->type==NTREE_COMPOSIT) {
-
- /* find the active outputs, might become tree type dependant handler */
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->typeinfo->nclass==NODE_CLASS_OUTPUT) {
- bNode *tnode;
- int output= 0;
-
- /* we need a check for which output node should be tagged like this, below an exception */
- if(node->type==CMP_NODE_OUTPUT_FILE)
- continue;
-
- /* there is more types having output class, each one is checked */
- for(tnode= ntree->nodes.first; tnode; tnode= tnode->next) {
- if(tnode->typeinfo->nclass==NODE_CLASS_OUTPUT) {
+ /* find the active outputs, might become tree type dependant handler */
+ for(node= ntree->nodes.first; node; node= node->next) {
+ if(node->typeinfo->nclass==NODE_CLASS_OUTPUT) {
+ bNode *tnode;
+ int output= 0;
+
+ /* we need a check for which output node should be tagged like this, below an exception */
+ if(node->type==CMP_NODE_OUTPUT_FILE)
+ continue;
+
+ /* there is more types having output class, each one is checked */
+ for(tnode= ntree->nodes.first; tnode; tnode= tnode->next) {
+ if(tnode->typeinfo->nclass==NODE_CLASS_OUTPUT) {
+
+ if(ntree->type==NTREE_COMPOSIT) {
+
/* same type, exception for viewer */
if(tnode->type==node->type ||
(ELEM(tnode->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER) &&
@@ -1731,10 +1732,20 @@ static void ntreeSetOutput(bNodeTree *ntree)
}
}
}
+ else {
+ /* same type */
+ if(tnode->type==node->type) {
+ if(tnode->flag & NODE_DO_OUTPUT) {
+ output++;
+ if(output>1)
+ tnode->flag &= ~NODE_DO_OUTPUT;
+ }
+ }
+ }
}
- if(output==0)
- node->flag |= NODE_DO_OUTPUT;
}
+ if(output==0)
+ node->flag |= NODE_DO_OUTPUT;
}
}