Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(21)

Issue 5727064: Node socket selection reimplemented (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 5 months ago by lukas.toenne
Modified:
14 years, 4 months ago
Reviewers:
brechtvl, bf-codereview
Base URL:
https://svn.blender.org/svnroot/bf-blender/trunk/blender/
Visibility:
Public.

Description

In 2.49 you could select not only nodes but also individual sockets. This is a helpful feature when it comes to creating links over long distances in the editor. The current click&hold + scrolling is very cumbersome, and the auto-connect feature between nodes is limited and not easily controllable. This patch reimplements the socket selection by adding two new operators, which toggle the SELECT flag on sockets based on the already used lookup function from linking. Default mapping is SELECTMOUSE (rmb). Selection state is shown as a simple white outline on sockets. This can be tweaked easily according to user feedback once in trunk. http://www.pasteall.org/pic/27820 Socket selection is limited to a single socket on the output side, since any input can only be linked to one output. In the future there may be special socket types that deviate from this "one to many" behavior. In that case all the operators will have to be checked anyway, most of them rely on this behavior to some extent. In addition to the new selection operators the "make link" operator has also changed: * The existing NODE_OT_link_make now uses socket selection for making links (default key mapping: FKEY, CTRL+FKEY for replacing existing links) (old link_make operator even still had all the 2.49 comments saying it uses socket selection ...) * A new NODE_OT_link_auto has been added with the old autoconnect behavior (key map ALT+FKEY, ALT+CTRL+FKEY) Not sure if this is a good change, but IMHO linking by socket selection is much more useful than autoconnect.

Patch Set 1 #

Patch Set 2 : Same operator used for socket and node connect #

Patch Set 3 : Avoid deselecting all sockets when selecting nodes a second time. Deselect all sockets after linking #

Unified diffs Side-by-side diffs Delta from patch set Stats (+449 lines, -101 lines) Patch
source/blender/editors/space_node/node_draw.c View 1 2 3 chunks +10 lines, -3 lines 0 comments Download
source/blender/editors/space_node/node_edit.c View 1 2 17 chunks +122 lines, -78 lines 0 comments Download
source/blender/editors/space_node/node_intern.h View 1 2 3 chunks +5 lines, -0 lines 0 comments Download
source/blender/editors/space_node/node_ops.c View 1 2 2 chunks +12 lines, -0 lines 0 comments Download
source/blender/editors/space_node/node_select.c View 1 2 12 chunks +300 lines, -20 lines 0 comments Download

Messages

Total messages: 7
lukas.toenne
14 years, 5 months ago (2012-03-05 16:39:40 UTC) #1
brechtvl
There does not seem to be any obvious way to deselect sockets, so when making ...
14 years, 5 months ago (2012-03-06 13:39:29 UTC) #2
lukas.toenne
Same operator used for socket and node connect
14 years, 4 months ago (2012-03-07 10:19:26 UTC) #3
lukas.toenne
Patch set 2 modifies the link_make operator instead of creating a separate one, so it ...
14 years, 4 months ago (2012-03-07 10:28:30 UTC) #4
lukas.toenne
Avoid deselecting all sockets when selecting nodes a second time. Deselect all sockets after linking
14 years, 4 months ago (2012-03-08 16:46:00 UTC) #5
brechtvl
Now I can't select sockets at all? Probably because it gets unselected after dragging. If ...
14 years, 4 months ago (2012-03-08 20:08:26 UTC) #6
lukas.toenne
14 years, 4 months ago (2012-03-09 10:06:01 UTC) #7
Ok, this is a bit tricky due to keymap inconsistency (SELECTMOUSE/ACTIONMOUSE
for select, LEFTMOUSE for link) and the need for operator pass-through, but i
think i have a nice solution. Problem is that in order to get to the link
operator the selection always has to return pass-through, but if socket select
does that then the node select op will deselect all previous nodes and sockets
again ...

What i did now is merge the socket selection operators into the existing node
select operator (sockets checked first, then nodes). This way the socket/node
blocking from overlap can be done completely internal in the operator, which is
also nicer because sockets are part of nodes after all.

Also sockets only get deselected when the link operator is successful (not on
cancel), so left click can still be used for socket select too.

The autoconnect operator could still use some tweaking to make it more reliable,
but i'd rather do that in a separate patch later. Tests look good, so will
commit this to trunk today.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b