diff options
author | Ton Roosendaal <ton@blender.org> | 2010-04-14 21:32:28 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2010-04-14 21:32:28 +0400 |
commit | 3f4a28dcf1cd0e82a20871b8402aae8d7d495a3c (patch) | |
tree | 2a0975955138649a7898d7d0f046fe4035ba22b4 /source | |
parent | a14398c883b81cbc3fe8d62f32c9edf8a3db9eab (diff) |
CTRL+SHIFT click on node "Make viewer connect to node" now also works
if there's no active viewer, or no existing link to viewer.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_node/node_edit.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index d6d1c8dc606..f1aa9f745ee 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -950,6 +950,15 @@ static void node_link_viewer(SpaceNode *snode, bNode *tonode) if( ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) if(node->flag & NODE_DO_OUTPUT) break; + /* no viewer, we make one active */ + if(node==NULL) { + for(node= snode->edittree->nodes.first; node; node= node->next) { + if( ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) { + node->flag |= NODE_DO_OUTPUT; + break; + } + } + } if(node) { bNodeLink *link; @@ -958,8 +967,13 @@ static void node_link_viewer(SpaceNode *snode, bNode *tonode) for(link= snode->edittree->links.first; link; link= link->next) if(link->tonode==node) break; - - if(link) { + + if(link==NULL) { + nodeAddLink(snode->edittree, tonode, tonode->outputs.first, node, node->inputs.first); + ntreeSolveOrder(snode->edittree); + NodeTagChanged(snode->edittree, node); + } + else if(link) { link->fromnode= tonode; link->fromsock= tonode->outputs.first; NodeTagChanged(snode->edittree, node); |