Page MenuHome

Geometry Nodes: Dashed lines for function flow
ClosedPublic

Authored by Dalai Felinto (dfelinto) on Sep 22 2021, 6:34 PM.
Tokens
"Heartbreak" token, awarded by corpse."Love" token, awarded by pablovazquez."Dislike" token, awarded by rawalanche."Dislike" token, awarded by manitwo."Love" token, awarded by HEYPictures.

Details

Summary

Use dashes to represent the function flow (while keeping continuous
lines for the data-flow).

Known limitations:

  • It would be nice to get the "uv.x" to be resampled for the bezier curve

so the dashes are equally distributed in the curve.

  • Using distance between the P3 and P0 instead of the real bezier curve

length seems to be fine.

Diff Detail

Repository
rB Blender
Branch
dashed-lines (branched from master)
Build Status
Buildable 17374
Build 17374: arc lint + arc unit

Event Timeline

Dalai Felinto (dfelinto) requested review of this revision.Sep 22 2021, 6:34 PM
Dalai Felinto (dfelinto) created this revision.

The one problem I see with this is that the dashed lines will be seen as "broken" links. I know there has been a patch in the past to use this style for broken links instead of the current red color. There is also the proposal to make links colored to match socket colors.

I think all three of these need to be tackled at once or at least have an overall design instead of focusing on one particular aspect

Hi @Aaron Carlisle (Blendify) do you have a suggestion of how those three ideas work together? Dashed lines are used already for parental relationship (in the viewport and the outliner). The function flow borrows from this and use this to establish the relation between the functions that are combined together in a specific order to be evaluated later.

The UI team is welcome to make a proposal for how to change the meaning of dashing in Blender (in a way that either address this for parenting as well, or that acknowledges that the meaning diverges there). I don't see enough action from the UI team on those topics to justify blocking such an improvement in the geometry nodes system.

Adding Clément here in case he wants to add his 2 cents on the shader solution itself.

I agree with Aaron. Of all the possible solutions, dashed line seems like by far the worst one for me, as to me (and likely many other people), spaces in the line imply something is broken, disabled, suspended, unavailable, etc... when seen next to full, uninterrupted lines. Function flow is in fact something stronger, more important that data flow, so it should actually be more visually bold, not less.

There is no such thing as "changing the meaning of dashing in Blender". Dashed lines are universal visual language which reaches far outside the world of Blender. While changing already existing, widely agreed upon meaning of something just in the context of Blender is a very Blender thing to do, it's not a good thing.

When it comes to distinguishing function flow from execution flow, here's what I propose:

  1. Make execution flow sockets truly distinct. Not just different color / shape but also a bit larger in size
  2. Make the execution flow node links width simply be a multiplier of node links width. So for example the execution flow node link thickness would always be 1.5x the size of data flow node links
  3. Make the execution flow node links have always higher opacity than the data flow links, so that for example, the execution flow node links have always alpha of 0.9 while data flow links have alpha of 0.5.

@Ludvik Koutny (rawalanche) if you have a different proposal for this, please do so with a visual mockup (ideally pixel perfect) in the corresponding task (T91563). The patch review is reserved for comments on the code, on how it relates to the original design, or how the design pans out upon realization.

@Clément Foucault (fclem) walked me over his approach to anti-alias. I will try to update the patch follow his math:

  • Updated the algorithm to handle a smoth alpha for anti-alias

Math 100% by Clément Foucault

Anti-alias:

No anti-alias (original patch):

Integrate the dash in the flow logic

Dalai Felinto (dfelinto) retitled this revision from Prototype for dashed lines for function flow to Geometry Nodes: Dashed lines for function flow.Sep 27 2021, 7:06 PM
Dalai Felinto (dfelinto) edited the summary of this revision. (Show Details)
Dalai Felinto (dfelinto) edited the summary of this revision. (Show Details)
  • Tweak the dash lines
This revision is now accepted and ready to land.Sep 28 2021, 12:22 PM
  • Support muted lines and reroutes

Before if those lines were falling in the dash gap they would
be invisible.