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>2006-12-06 00:33:56 +0300
committerTon Roosendaal <ton@blender.org>2006-12-06 00:33:56 +0300
commit09d3d15f45dfd2685253d5edd49566e2eab5ec4e (patch)
treea721f5784605f39362202f2ccccd95343f29263e /source/blender/src/header_node.c
parent5e52bee5a7ba17e31d5195ad59913429a05457d4 (diff)
Node editor: when adding a new node, automatic links are created:
- from all selected nodes - only connections between highest order socket types; so if there's RGBA and Value sockets, only RGBA sockets are connected. This because in these cases the Value sockets usually are for user input. Example: Mix node. Thanks Trip for the hint!
Diffstat (limited to 'source/blender/src/header_node.c')
-rw-r--r--source/blender/src/header_node.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/src/header_node.c b/source/blender/src/header_node.c
index a29c94cf45d..51629fb0a98 100644
--- a/source/blender/src/header_node.c
+++ b/source/blender/src/header_node.c
@@ -198,13 +198,23 @@ static uiBlock *node_selectmenu(void *arg_unused)
void do_node_addmenu(void *arg, int event)
{
SpaceNode *snode= curarea->spacedata.first;
+ bNode *node;
float locx, locy;
short mval[2];
+ /* store selection in temp test flag */
+ for(node= snode->edittree->nodes.first; node; node= node->next) {
+ if(node->flag & NODE_SELECT) node->flag |= NODE_TEST;
+ else node->flag &= ~NODE_TEST;
+ }
+
getmouseco_areawin(mval);
areamouseco_to_ipoco(G.v2d, mval, &locx, &locy);
- node_add_node(snode, event, locx, locy);
+ node= node_add_node(snode, event, locx, locy);
+ /* uses test flag */
+ snode_autoconnect(snode, node, NODE_TEST);
+
addqueue(curarea->win, UI_BUT_EVENT, B_NODE_TREE_EXEC);
BIF_undo_push("Add Node");