Page MenuHome

UI: Draw real node sockets for node-input buttons and left-align them
ClosedPublic

Authored by Julian Eisel (Severin) on Apr 13 2020, 5:23 PM.
Tags
None
Subscribers
None
Tokens
"Like" token, awarded by antoniov."100" token, awarded by fclem."Burninate" token, awarded by RomanKornev.

Details

Summary
E.g.
Default DPI:
For comparison, this is master:

Couple of reasons for this:

  • Makes it easier to understand that and how these buttons map to nodes.
  • These buttons represent node inputs, so it makes more sense to have the icons on the left.
  • We'd like to show the usual decorators on the right, but having two circles for different purposes next to each other would be confusing.

Also respects the socket shape. So if a diamond shape is used for example, the
properties show that too.

I'm not sure if the previous icon textures were cached, either way this method
uses immediate mode drawing (reusing the existing drawing code, so it draws
one point per icon and does the rest in shaders). So this adds a draw call for
every socket icon which is a bit annoying, but probably neglectable. Would be
better if we'd use proper icon textures or batches, but that's a separate
change.

Diff Detail

Repository
rB Blender

Event Timeline

Julian Eisel (Severin) requested review of this revision.Apr 13 2020, 5:23 PM
Julian Eisel (Severin) created this revision.
Julian Eisel (Severin) edited the summary of this revision. (Show Details)Apr 13 2020, 5:28 PM

From a UI POV this is super nice, and much better allows us to use decorators on the right. Tested, seems to work as advertised.

This revision is now accepted and ready to land.Apr 13 2020, 6:29 PM

I don't see the need for optimizing this for now. So it's a +1 for me.
Good job!

source/blender/editors/space_node/node_draw.c
710–715

Don't ask why I changed this return type, no clue. (Will undo before committing.)