Page MenuHome

Node Editor: Introduce color overlay and dashed wires theme setting
ClosedPublic

Authored by Pablo Vazquez (pablovazquez) on Oct 15 2021, 10:11 PM.
Tags
None
Tokens
"Like" token, awarded by Fracture128."Love" token, awarded by Mylo."Love" token, awarded by luischerubini."Love" token, awarded by Aeraglyx."Love" token, awarded by rawalanche."Party Time" token, awarded by costavojik."Love" token, awarded by mistrzjang."Love" token, awarded by HEYPictures."Love" token, awarded by Stig."Like" token, awarded by GeorgiaPacific."Love" token, awarded by Yuro."Love" token, awarded by Draise."Love" token, awarded by MasterNurmi."Love" token, awarded by Leul."Love" token, awarded by Chf.

Details

Summary

This patch includes code from D9891 and D12754, so credit goes to Juanfran and Dalai.
I updated the patches to work with master and with the new overlay toggle.

The reason to include both changes as part of one patch is that the dimmed dashed lines work much better together with colored wires.

Theme setting for dash opacity:

For adding the overlay I used SpaceImageOverlay as reference, although I'm not familiar with this code so there might be mistakes.

Diff Detail

Repository
rB Blender

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Pablo Vazquez (pablovazquez) requested review of this revision.Oct 15 2021, 10:11 PM

Use shortcut to toggle overlays (Alt+Shift+Z)

Nice!
Maybe the overlays could have other options like Grid and Grid Levels, Outline Selected, Frames, Noodle curving and maybe even Noodles themselves! Trying to mimic more the 3D View options. Quite some time I was waiting for these cosmetic changes, happy to see all these patches!

I'm mostly asking this because I'm curious, I don't want to bike-shed or slow anything down too much-- did you ever try short dashes instead of very long ones? They still look really nice IMO, and feel more like a dashed lines than lines that have sections with different shades.

The dashes should probably be turned on by default in versioning, because they may help people understand fields and it's the first time they will be visible. It would probably be less controversial too :)

source/blender/gpu/shaders/gpu_shader_2D_nodelink_vert.glsl
70

These two comments "cause some visual shift issue" are very vague, I have no idea what that is supposed to mean.
@Juanfran Matheu (jfmatheu), could you describe what you meant here in a little more detail?

"cause" is also incorrect grammar, it should say "because of".

source/blender/makesrna/intern/rna_space.c
7038

Maybe it's subjective, but I find "Color node links based on their connected sockets" reads a little better.

I think this is an excellent solution to a community UX debate.

Yuro (Yuro) added a subscriber: Yuro (Yuro).

I'm mostly asking this because I'm curious, I don't want to bike-shed or slow anything down too much-- did you ever try short dashes instead of very long ones? They still look really nice IMO, and feel more like a dashed lines than lines that have sections with different shades.

The dashes should probably be turned on by default in versioning, because they may help people understand fields and it's the first time they will be visible. It would probably be less controversial too :)

Building on what Hans asked, and perhaps going too far, what about an option for the user to set the length of the dashes? I would prefer shorter ones that are closer to a series of dots, but others might like longer ones.

Jesse Yurkovich (deadpin) added inline comments.
release/scripts/startup/bl_ui/space_node.py
709

This is a little ambiguous as it could mean "use dashed wires for everything". I suspect a better set of words might be "Dashed Field Wires" to better indicate that only the Field noodles will change. If "Field" isn't to be used in the UI, then maybe something else is still needed?

@Hans Goudey (HooglyBoogly) That code is from so long that I have to check this patch and see if now that threshold is correct or even relevant.
But as a short explanation, start_gradient_threshold and end_gradient_threshold area meant to shrink and grow the gradient effect, like pushing and pulling the corners (start/end) to have a more or less smooth transition.
The point of that comment - in that moment - is that the center of the wires was a bit off so that's why those values were set less centered, that is, from around 0.5 (centered) to around 0.4 (offset to left). But as said, I have to check well it now and I will provide a diff here for that specific part is case it needs some tweak.

I'm mostly asking this because I'm curious, I don't want to bike-shed or slow anything down too much-- did you ever try short dashes instead of very long ones? They still look really nice IMO, and feel more like a dashed lines than lines that have sections with different shades.

The dashes should probably be turned on by default in versioning, because they may help people understand fields and it's the first time they will be visible. It would probably be less controversial too :)

Building on what Hans asked, and perhaps going too far, what about an option for the user to set the length of the dashes? I would prefer shorter ones that are closer to a series of dots, but others might like longer ones.

Riccardo Bancone posted the following in the Geometry Nodes DevTalk thread: 'If He’ll add dash density, dash opacity and wires thickness (Separate for fields and Geo) controls that will be the perfect balance between quick customization and simplicity IMHO.' Please overlook my posting a second time here if that is not appropriate. I love this patch and where it is going. Adding dash density, dash opacity, and wires thickness controls (maybe as a future patch, if that is too much for now) would make the nodes visual customization that this introduces even better. Thank you for adding this customization as an option!

Update patch with suggestions on text and dashes width.

Pablo Vazquez (pablovazquez) marked 2 inline comments as done.

Fix typo in comment regarding a visual shift issue.

Pablo Vazquez (pablovazquez) marked an inline comment as done.Oct 17 2021, 7:37 PM

Turn Node Editor overlays on by default.

This bumps file subversion.

Just for the records (I talked to Pablo about that in real life as well): I don't think dashed lines should be an option. The same way the socket shape is not an option (I borrow this argument from someone else ;) )

Update patch based on notes.

  • Remove option to toggle dashed wires. Dashed wires are not something drawn on top, they are part of Fields, akin to diamond-shaped sockets.
  • Add option to toggle Annotations in overlay popover, to match 3D Viewport (this should be added to the Image editor as well, in another patch)
Pablo Vazquez (pablovazquez) edited the summary of this revision. (Show Details)

Some changes are still planned for this patch I think, I'll check again after that.

release/scripts/startup/bl_ui/space_node.py
699

What about "Node Editor Overlays"? Feels a bit more complete to me.

source/blender/makesdna/DNA_space_types.h
1514

Since conceptually, this padding is necessary for SpaceNode, not really this struct by itself, I think it would be better to add it below.

source/blender/makesrna/intern/rna_space.c
7231

Description needs updating

Pablo Vazquez (pablovazquez) edited the summary of this revision. (Show Details)
  • Use "Node Editor Overlays", suggested by Hans
  • Fix tooltip
  • Place pad inside SpaceNode.
  • Merge branch 'master' into arcpatch-D12886
Pablo Vazquez (pablovazquez) marked 3 inline comments as done.Oct 20 2021, 8:12 PM
Hans Goudey (HooglyBoogly) added inline comments.
release/scripts/startup/bl_ui/space_node.py
707

Another picky language thing, but maybe "Wire Colors" sounds a bit more natural and more like a noun than "Color Wires". Unless you were going for the "Color as a verb" thing.

This revision is now accepted and ready to land.Oct 20 2021, 9:10 PM
  • Rename "color wires" to "wire colors"
  • New theme setting to control dash alpha in Node Editor
  • Use dash_alpha theme setting to control opacity of dashes

Pablo Vazquez (pablovazquez) marked an inline comment as done.Oct 21 2021, 8:30 PM
Pablo Vazquez (pablovazquez) added inline comments.
release/scripts/startup/bl_ui/space_node.py
707

It was indeed written as verb but you're right it, "Wire Colors" sounds more natural.

Pablo Vazquez (pablovazquez) retitled this revision from Node Editor: Introduce color and dashed wires overlay to Node Editor: Introduce color overlay and dashed wires theme setting.Oct 21 2021, 8:36 PM
Pablo Vazquez (pablovazquez) edited the summary of this revision. (Show Details)

Looking good!

source/blender/editors/space_node/drawnode.cc
4237–4238

const ;)

Pablo Vazquez (pablovazquez) marked an inline comment as done.

Add dash_alpha theme setting to default themes.

Pablo Vazquez (pablovazquez) marked an inline comment as done.Oct 21 2021, 8:50 PM
  • Merge branch 'master' into arcpatch-D12886