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:
authorBastien Montagne <montagne29@wanadoo.fr>2011-11-20 20:38:23 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2011-11-20 20:38:23 +0400
commit6673c76e78742c64ccd0afa7a9d1f598a8022878 (patch)
tree5304bf79c57391c4dcc561746e770e006ba45e18 /source/blender/nodes/composite/node_composite_util.c
parentbbf8315313a9e221ba398bbe06e342bd949c973b (diff)
Muting node patch: second part. Also fix [#27636] Muting shading nodes is ignored
Now, compositing, shading and texture nodes have a consistent muting system, with default behaving as previous (for compo), and which can be optionaly customized by each node. Shader nodes are also GLSL muted. However, Cycles is currently unaware of muted nodes, will try to address this…
Diffstat (limited to 'source/blender/nodes/composite/node_composite_util.c')
-rw-r--r--source/blender/nodes/composite/node_composite_util.c55
1 files changed, 20 insertions, 35 deletions
diff --git a/source/blender/nodes/composite/node_composite_util.c b/source/blender/nodes/composite/node_composite_util.c
index ddd55790436..99a36691b10 100644
--- a/source/blender/nodes/composite/node_composite_util.c
+++ b/source/blender/nodes/composite/node_composite_util.c
@@ -131,44 +131,29 @@ void compbuf_set_node(CompBuf *cbuf, bNode *node)
}
/* used for disabling node (similar code in node_draw.c for disable line and node_edit for untangling nodes) */
-void node_compo_pass_on(bNode *node, bNodeStack **nsin, bNodeStack **nsout)
+void node_compo_pass_on(void *UNUSED(data), int UNUSED(thread), struct bNode *node, void *UNUSED(nodedata),
+ struct bNodeStack **in, struct bNodeStack **out)
{
- CompBuf *valbuf= NULL, *colbuf= NULL, *vecbuf= NULL;
- bNodeSocket *sock;
- int a;
-
- /* connect the first value buffer in with first value out */
- /* connect the first RGBA buffer in with first RGBA out */
-
- /* test the inputs */
- for(a=0, sock= node->inputs.first; sock; sock= sock->next, a++) {
- if(nsin[a]->data) {
- CompBuf *cbuf= nsin[a]->data;
- if(cbuf->type==1 && valbuf==NULL) valbuf= cbuf;
- if(cbuf->type==3 && vecbuf==NULL) vecbuf= cbuf;
- if(cbuf->type==4 && colbuf==NULL) colbuf= cbuf;
- }
- }
-
- /* outputs */
- if(valbuf || colbuf || vecbuf) {
- for(a=0, sock= node->outputs.first; sock; sock= sock->next, a++) {
- if(nsout[a]->hasoutput) {
- if(sock->type==SOCK_FLOAT && valbuf) {
- nsout[a]->data= pass_on_compbuf(valbuf);
- valbuf= NULL;
- }
- if(sock->type==SOCK_VECTOR && vecbuf) {
- nsout[a]->data= pass_on_compbuf(vecbuf);
- vecbuf= NULL;
- }
- if(sock->type==SOCK_RGBA && colbuf) {
- nsout[a]->data= pass_on_compbuf(colbuf);
- colbuf= NULL;
- }
- }
+ ListBase links;
+ LinkInOutsMuteNode *lnk;
+ int i;
+
+ if(node->typeinfo->mutelinksfunc == NULL)
+ return;
+
+ /* Get default muting links (as bNodeStack pointers). */
+ links = node->typeinfo->mutelinksfunc(NULL, node, in, out, NULL, NULL);
+
+ for(lnk = links.first; lnk; lnk = lnk->next) {
+ for(i = 0; i < lnk->num_outs; i++) {
+ if(((bNodeStack*)(lnk->in))->data)
+ (((bNodeStack*)(lnk->outs))+i)->data = pass_on_compbuf((CompBuf*)((bNodeStack*)(lnk->in))->data);
}
+ /* If num_outs > 1, lnk->outs was an allocated table of pointers... */
+ if(i > 1)
+ MEM_freeN(lnk->outs);
}
+ BLI_freelistN(&links);
}