Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/node.cc
| Show First 20 Lines • Show All 3,108 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| void ntreeSetOutput(bNodeTree *ntree) | void ntreeSetOutput(bNodeTree *ntree) | ||||
| { | { | ||||
| /* find the active outputs, might become tree type dependent handler */ | /* find the active outputs, might become tree type dependent handler */ | ||||
| LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { | LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { | ||||
| if (node->typeinfo->nclass == NODE_CLASS_OUTPUT) { | if (node->typeinfo->nclass == NODE_CLASS_OUTPUT) { | ||||
| /* we need a check for which output node should be tagged like this, below an exception */ | /* we need a check for which output node should be tagged like this, below an exception */ | ||||
| if (node->type == CMP_NODE_OUTPUT_FILE) { | if (ELEM(node->type, CMP_NODE_OUTPUT_FILE, GEO_NODE_VIEWER)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| int output = 0; | int output = 0; | ||||
| /* there is more types having output class, each one is checked */ | /* there is more types having output class, each one is checked */ | ||||
| LISTBASE_FOREACH (bNode *, tnode, &ntree->nodes) { | LISTBASE_FOREACH (bNode *, tnode, &ntree->nodes) { | ||||
| if (tnode->typeinfo->nclass == NODE_CLASS_OUTPUT) { | if (tnode->typeinfo->nclass == NODE_CLASS_OUTPUT) { | ||||
| if (ntree->type == NTREE_COMPOSIT) { | if (ntree->type == NTREE_COMPOSIT) { | ||||
| /* same type, exception for viewer */ | /* same type, exception for viewer */ | ||||
| if (tnode->type == node->type || | if (tnode->type == node->type || | ||||
| (ELEM(tnode->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER, GEO_NODE_VIEWER) && | (ELEM(tnode->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER) && | ||||
| ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER, GEO_NODE_VIEWER))) { | ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))) { | ||||
| if (tnode->flag & NODE_DO_OUTPUT) { | if (tnode->flag & NODE_DO_OUTPUT) { | ||||
| output++; | output++; | ||||
| if (output > 1) { | if (output > 1) { | ||||
| tnode->flag &= ~NODE_DO_OUTPUT; | tnode->flag &= ~NODE_DO_OUTPUT; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,873 Lines • Show Last 20 Lines | |||||