Page MenuHome

Node Editor: Adjust node link curving
ClosedPublic

Authored by Leon Schittek (lone_noel) on Sep 22 2022, 3:51 PM.

Details

Summary

Clamp node link curving when the link is close to horizontal.


Issue
Since rBee1d5fb9e467 curved node links always attach to sockets facing
horizontally, entering them from the left and leaving them to the right.
This can look weird, when reroutes are used to route links backwards
horizontally and the ends overshoot.
This type of link routing seems to be commonly used with straight node
links, so it makes sense to support it better with curved links, as
well.

This came up, when discussing T98779 with @Pablo Vazquez (pablovazquez)

Idea
This patch effectively decreases the link curving as the end points get
close to horizontal preventing the overshoot.
A side effect of this is, that the link curving is smoothed out a bit
in general when node links are very horizontal, which I think looks
nicer with very strong link curving anyway.

masterpatch
cuving = 4 (default)
curving = 10 (max)
all curving levels (.gif)

Diff Detail

Repository
rB Blender
Branch
node-ui-adjust-link-curving (branched from master)
Build Status
Buildable 23889
Build 23889: arc lint + arc unit

Event Timeline

Leon Schittek (lone_noel) requested review of this revision.Sep 22 2022, 3:51 PM
Leon Schittek (lone_noel) created this revision.
Leon Schittek (lone_noel) added projects: Nodes & Physics, Restricted Project.

I like the change, it's a nice compromise. Would be good to get Pablo's opinion too though.

source/blender/editors/space_node/drawnode.cc
1613–1614

Could you split this up into two lines with an intermediate variable? There's a lot going on here now which makes it a bit more complex-looking than necessary.

Leon Schittek (lone_noel) marked an inline comment as done.
  • Extract variable to improve readability.

SO much nicer! Thanks for looking into this.

Also props for making such clear demos testing all kinds of ways and different noodle curving.

This revision is now accepted and ready to land.Sep 23 2022, 12:42 PM

It solves the problem perfectly, thank you for your work @Leon Schittek (lone_noel) !

This revision was automatically updated to reflect the committed changes.