Page MenuHome

Add a label for texture sockets
ClosedPublic

Authored by Wannes Malfait (Wannes) on Jun 30 2021, 12:13 PM.

Details

Summary

This makes texture sockets have a label by default. This can be changed
by adding the SOCK_HIDE_LABEL flag to the socket. With this change the
switch node now shows the labels "True" and "False" like for the other
types of sockets.

UI:

Diff Detail

Repository
rB Blender
Branch
master
Build Status
Buildable 15515
Build 15515: arc lint + arc unit

Event Timeline

Wannes Malfait (Wannes) requested review of this revision.Jun 30 2021, 12:13 PM
Wannes Malfait (Wannes) created this revision.

I think you might have to do something like the string socket does currently with uiLayout *row = uiLayoutSplit(layout, 0.4f, false); to get the alignment to look nicer.

Wannes Malfait (Wannes) edited the summary of this revision. (Show Details)
  • Use split to get prettier UI
Wannes Malfait (Wannes) edited the summary of this revision. (Show Details)Jun 30 2021, 6:12 PM
source/blender/editors/space_node/drawnode.cc
3616

0.4 is generally the standard for splits in the UI currently. I guess you used 0.3 because otherwise the buttons get squashed at the default node width? I wonder if it's worth it to differ here.

source/blender/editors/space_node/drawnode.cc
3616

Yup, I tried 0.4f first and it didn't look good enough, so I went with 0.3f. If that is not Ok, we'd need to use a different function here to get a better layout.

This revision is now accepted and ready to land.Aug 9 2021, 6:53 AM