Geometry Nodes: align input and output sockets in simulation and repeat zone nodes #118335

Merged
Jacques Lucke merged 4 commits from JacquesLucke/blender:inline-zone-sockets into main 2024-02-19 13:32:09 +01:00
Member

This changes the drawing of the zone nodes to align corresponding input and output sockets. The resulting nodes are smaller and it's easier to see how data is passed through them.

Drawing aligned sockets is already technically supported for quite a while already, but we haven't used it so far. Using them for zone nodes seems to provide benefits only. How we use aligned sockets in other nodes still has to be discussed more.

This patch only changes run-time data. It doesn't affect what is written to .blend files.

In the node declaration, aligned sockets are created by tagging a socket so that it is aligned with the previous socket. This is a bit different from what we had before where a single socket declaration would be used for an input and output socket. I think the approach used here works better, especially in a potential future scenario where the input and output socket has a different type.

Before:
image

After:
image

This changes the drawing of the zone nodes to align corresponding input and output sockets. The resulting nodes are smaller and it's easier to see how data is passed through them. Drawing aligned sockets is already technically supported for quite a while already, but we haven't used it so far. Using them for zone nodes seems to provide benefits only. How we use aligned sockets in other nodes still has to be discussed more. This patch only changes run-time data. It doesn't affect what is written to .blend files. In the node declaration, aligned sockets are created by tagging a socket so that it is aligned with the previous socket. This is a bit different from what we had before where a single socket declaration would be used for an input and output socket. I think the approach used here works better, especially in a potential future scenario where the input and output socket has a different type. Before: ![image](/attachments/1a6b1720-059e-4ab1-8a01-061bb5daad60) After: ![image](/attachments/ab756d37-8a4a-413e-b322-bbacaa06c7d8)
Jacques Lucke added 2 commits 2024-02-15 16:48:06 +01:00
Jacques Lucke requested review from Dalai Felinto 2024-02-15 16:53:50 +01:00
Jacques Lucke requested review from Simon Thommes 2024-02-15 16:53:51 +01:00
Jacques Lucke requested review from Hans Goudey 2024-02-15 16:53:51 +01:00
Jacques Lucke requested review from Lukas Tönne 2024-02-15 16:54:00 +01:00
Lukas Tönne requested changes 2024-02-15 17:10:50 +01:00
Lukas Tönne left a comment
Member

Code-wise the change for aligned sockets looks fine, nice to see the feature still works.
I don't agree with removing the is_valid check (see inline comment), should probably be a separate PR.
Design-wise i'd like to confirm with UI team or whoever is responsible, last time adding the feature didn't end so well and it had to be disabled again.

Code-wise the change for aligned sockets looks fine, nice to see the feature still works. I don't agree with removing the `is_valid` check (see inline comment), should probably be a separate PR. Design-wise i'd like to confirm with UI team or whoever is responsible, last time adding the feature didn't end so well and it had to be disabled again.
@ -467,4 +475,2 @@
friend NodeDeclarationBuilder;
/** Returns true if the declaration is considered valid. */
bool is_valid() const;
Member

Not sure i agree with removing this. It tests for socket/panel ordering which is not enforced through syntax alone. As a simple test move the Principled BSDF output down one line - it will trip the validity check here.
1bf6d8b0b9/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.cc (L27)

We could maybe move this to a utility function, but i think it's worth keeping. In any case, it's also an unrelated change.

Not sure i agree with removing this. It tests for socket/panel ordering which is not enforced through syntax alone. As a simple test move the Principled BSDF output down one line - it will trip the validity check here. https://projects.blender.org/blender/blender/src/commit/1bf6d8b0b905fbac4235e2ac8329538997a03d38/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.cc#L27 We could maybe move this to a utility function, but i think it's worth keeping. In any case, it's also an unrelated change.
JacquesLucke marked this conversation as resolved
Hans Goudey approved these changes 2024-02-15 17:48:31 +01:00

If @pablovazquez is fine with it I'm okay.

Thanks for keeping me in the loop.

If @pablovazquez is fine with it I'm okay. Thanks for keeping me in the loop.
Pablo Vazquez approved these changes 2024-02-15 19:17:27 +01:00
Pablo Vazquez left a comment
Member

+1. Glad to see this functionality finally in use.

I hope at some point we reconsider to do it for other nodes.

+1. Glad to see this functionality finally in use. I hope at some point we reconsider to do it for other nodes.
Jacques Lucke added 2 commits 2024-02-15 20:51:31 +01:00
Jacques Lucke requested review from Lukas Tönne 2024-02-15 20:51:52 +01:00
Lukas Tönne approved these changes 2024-02-15 22:41:22 +01:00
Simon Thommes reviewed 2024-02-16 11:29:31 +01:00
Simon Thommes left a comment
Member

Since we went over the whole inline sockets idea before, I feel like it would make sense to already consider the general order of sockets that we ended up with. The it is right now would mean there are non-inlined sockets before inlined ones in the same panel.

So I'd suggest to put the inlined sockets into a panel like we discussed then.

But I don't feel strongly about this, since this would be the only nodes so far and we don't really do panels in builtin nodes yet. Just a suggestion.

Since we went over the whole inline sockets idea before, I feel like it would make sense to already consider the general order of sockets that we ended up with. The it is right now would mean there are non-inlined sockets before inlined ones in the same panel. So I'd suggest to put the inlined sockets into a panel like we discussed then. But I don't feel strongly about this, since this would be the only nodes so far and we don't really do panels in builtin nodes yet. Just a suggestion.
First-time contributor

How about always putting Geometry at the top like so?:

align.jpg

How about always putting Geometry at the top like so?: ![align.jpg](/attachments/d0010a6d-d09d-4428-801b-24e7a34487a9)
Member

How about always putting Geometry at the top like so?:

align.jpg

I wouldn't do this for multiple reasons:

  • there's nothing inherently special about the first geometry socket, since there can be multiple
  • this disconnects the attributes stored on the geometry from the geometry socket itself
  • this makes the readability worse with single in/out sockets being in between inline sockets, which we should not do generally
> How about always putting Geometry at the top like so?: > > ![align.jpg](/attachments/d0010a6d-d09d-4428-801b-24e7a34487a9) I wouldn't do this for multiple reasons: - there's nothing inherently special about the first geometry socket, since there can be multiple - this disconnects the attributes stored on the geometry from the geometry socket itself - this makes the readability worse with single in/out sockets being in between inline sockets, which we should not do generally
Author
Member

So I'd suggest to put the inlined sockets into a panel like we discussed then.

Fine with me, do you have a suggestion for how the panels should be called?

> So I'd suggest to put the inlined sockets into a panel like we discussed then. Fine with me, do you have a suggestion for how the panels should be called?
Member

IMO putting all the sockets into panels doesn't really improve the design, it just takes up extra space. I don't see people wanting to collapse them, and they aren't some different concept that needs an explanatory label.

I think we should define the guidelines around what looks and works best in real situations. Adding panels here seems more like the other way around-- we currently have the guideline for more abstract reasons of "consistency".

IMO putting all the sockets into panels doesn't really improve the design, it just takes up extra space. I don't see people wanting to collapse them, and they aren't some different concept that needs an explanatory label. I think we should define the guidelines around what looks and works best in real situations. Adding panels here seems more like the other way around-- we currently have the guideline for more abstract reasons of "consistency".
Author
Member

Talked to Simon. It's ok to not at panels right now. Maybe something we want to do later as we gain more experience and have more cases to be consistent with.

Talked to Simon. It's ok to not at panels right now. Maybe something we want to do later as we gain more experience and have more cases to be consistent with.
Jacques Lucke merged commit 1f30f41af8 into main 2024-02-19 13:32:09 +01:00
Jacques Lucke deleted branch inline-zone-sockets 2024-02-19 13:32:11 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser Project (Legacy)
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
7 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#118335
No description provided.