[Bf-codereview] Node socket selection reimplemented (issue 5727064)

lukas.toenne at googlemail.com lukas.toenne at googlemail.com
Mon Mar 5 17:39:40 CET 2012


Reviewers: bf-codereview_blender.org,

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.

Please review this at http://codereview.appspot.com/5727064/

Affected files:
   source/blender/editors/space_node/node_draw.c
   source/blender/editors/space_node/node_edit.c
   source/blender/editors/space_node/node_intern.h
   source/blender/editors/space_node/node_ops.c
   source/blender/editors/space_node/node_select.c




More information about the Bf-codereview mailing list