diff options
author | Ton Roosendaal <ton@blender.org> | 2008-03-08 22:02:08 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2008-03-08 22:02:08 +0300 |
commit | d7ef04a51939c49c32c0d82b0c53bd71788e760f (patch) | |
tree | ea932ba5ae957afd849ba1f6823ac41e440733b9 /source/blender/nodes | |
parent | 19ec73c908a2cb05104bea49afdb0b4c7452443f (diff) |
Long on the wishlist, quite simple even, and there it finally is:
Compositor:
Muting option to temporary disable/enable nodes.
Hotkey: press M on selection. It toggles.
Note: no menu entry yet, and drawing style could be tweakered...
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/intern/CMP_util.c | 42 | ||||
-rw-r--r-- | source/blender/nodes/intern/CMP_util.h | 1 |
2 files changed, 43 insertions, 0 deletions
diff --git a/source/blender/nodes/intern/CMP_util.c b/source/blender/nodes/intern/CMP_util.c index 21e0f034a15..a2629aa396e 100644 --- a/source/blender/nodes/intern/CMP_util.c +++ b/source/blender/nodes/intern/CMP_util.c @@ -122,6 +122,48 @@ void print_compbuf(char *str, CompBuf *cbuf) } +/* used for disabling node (similar code in drawnode.c for disable line) */ +void node_compo_pass_on(bNode *node, bNodeStack **nsin, bNodeStack **nsout) +{ + 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_VALUE && 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; + } + } + } + } +} + + CompBuf *get_cropped_compbuf(rcti *drect, float *rectf, int rectx, int recty, int type) { CompBuf *cbuf; diff --git a/source/blender/nodes/intern/CMP_util.h b/source/blender/nodes/intern/CMP_util.h index 6fa5251710a..a0e2f90f0da 100644 --- a/source/blender/nodes/intern/CMP_util.h +++ b/source/blender/nodes/intern/CMP_util.h @@ -132,6 +132,7 @@ CompBuf *dupalloc_compbuf(CompBuf *cbuf); CompBuf *pass_on_compbuf(CompBuf *cbuf); void free_compbuf(CompBuf *cbuf); void print_compbuf(char *str, CompBuf *cbuf); +void node_compo_pass_on(struct bNode *node, struct bNodeStack **nsin, struct bNodeStack **nsout); CompBuf *get_cropped_compbuf(rcti *drect, float *rectf, int rectx, int recty, int type); CompBuf *scalefast_compbuf(CompBuf *inbuf, int newx, int newy); |