Nodes: revert the inline (pass-through) socket feature #112560

Merged
Lukas Tönne merged 11 commits from LukasTonne/blender:nodes-revert-inline-sockets into main 2023-09-22 16:57:06 +02:00
Member

Inlined sockets in the same vertical space are no longer supported.
This removes input_output socket declarations, the inlining feature in
node drawing, and the Both option for node group interface sockets.

Versioning code splits existing node group sockets into individual
sockets again. Unfortunately some links may get lost in versioning files
using the feature, because of an unnoticed bug: Socket identifiers have
to be unique in the node group items list but inlined input/output
sockets have the same identifier. This still works for most situations
because uniqueness is only required within input/output lists. Creating
proper unique identifiers will discard any link from the previous output
socket. This cannot easily be fixed without after_linking versioning
code, which should be avoided.

Inlined sockets in the same vertical space are no longer supported. This removes `input_output` socket declarations, the inlining feature in node drawing, and the `Both` option for node group interface sockets. Versioning code splits existing node group sockets into individual sockets again. Unfortunately some links may get lost in versioning files using the feature, because of an unnoticed bug: Socket identifiers have to be unique in the node group items list but inlined input/output sockets have the same identifier. This still works for most situations because uniqueness is only required within input/output lists. Creating proper unique identifiers will discard any link from the previous output socket. This cannot easily be fixed without `after_linking` versioning code, which should be avoided.
Lukas Tönne added 2 commits 2023-09-19 10:31:17 +02:00
Lukas Tönne requested review from Jacques Lucke 2023-09-19 10:31:26 +02:00
Lukas Tönne added this to the Nodes & Physics project 2023-09-19 10:31:30 +02:00
Author
Member

@dfelinto Do we also want to remove the Both socket option (only allow single input/output sockets)? If we want to enforce strict outputs..inputs sorting these pass-through sockets become weird, the two sockets can be far apart.

@dfelinto Do we also want to remove the `Both` socket option (only allow single input/output sockets)? If we want to enforce strict outputs..inputs sorting these pass-through sockets become weird, the two sockets can be far apart.
Member

I haven't tested this but would this feature allow the following, this would be a shame to lose as it would allow users to reduce the amount of nodes they need to add.

image

I haven't tested this but would this feature allow the following, this would be a shame to lose as it would allow users to reduce the amount of nodes they need to add. ![image](/attachments/60c3a37d-953f-432a-9869-7396dfd43e36)
Author
Member

@CharlieJolly No it doesn't work like that. The inlining is purely a UI feature, while "pass-through" is a description of intended functionality (but nothing enforcing how nodes use these).

@CharlieJolly No it doesn't work like that. The inlining is purely a UI feature, while "pass-through" is a description of _intended_ functionality (but nothing enforcing how nodes use these).

@dfelinto Do we also want to remove the Both socket option (only allow single input/output sockets)? If we want to enforce strict outputs..inputs sorting these pass-through sockets become weird, the two sockets can be far apart.

Yes, it makes no sense to have the "Both" in this scenario. But I'm not sure I understand the point you are making (are you "pro" or against" removing the "Both"?)

> @dfelinto Do we also want to remove the `Both` socket option (only allow single input/output sockets)? If we want to enforce strict outputs..inputs sorting these pass-through sockets become weird, the two sockets can be far apart. Yes, it makes no sense to have the "Both" in this scenario. But I'm not sure I understand the point you are making (are you "pro" or against" removing the "Both"?)

Just for context, since this may be the first place people find about this.

The idea behind the inlined sockets was to provice an elegant way to get the nodes to be more compact. This topic is still on the agenda, but this particular solution has some shortcomes and wasn't widely well received.

The current (3.6) solution is based on the principles of "form-follow-function", where the function of the inputs/outputs is to be a list of parameters for the node. That was the original thought behind the compositor nodes design back in Elephants Dream day's.

Just for context, since this may be the first place people find about this. The idea behind the inlined sockets was to provice an elegant way to get the nodes to be more compact. This topic is still on the agenda, but this particular solution has some shortcomes and wasn't widely well received. The current (3.6) solution is based on the principles of "form-follow-function", where the function of the inputs/outputs is to be a list of parameters for the node. That was the original thought behind the compositor nodes design back in Elephants Dream day's.
Author
Member

Without the inlining i think it makes more sense to remove Both option as well. It generates alternating input/output atm and if we sort these the two sockets move even further apart, making it difficult to figure out which group socket declaration belongs to which pair of sockets.
image

Without the inlining i think it makes more sense to remove `Both` option as well. It generates alternating input/output atm and if we sort these the two sockets move even further apart, making it difficult to figure out which group socket declaration belongs to which pair of sockets. ![image](/attachments/7f9f6676-d63e-4037-8e63-d60cee2621b9)
Lukas Tönne added 1 commit 2023-09-19 12:07:35 +02:00
6563e3e6b8 Remove the 'Both' socket in/out enum value.
This feature does not make much sense without inlined sockets. All
sockets are back to being either inputs or outputs.
Contributor

Will separate panels for Input and Output sockets come back as well? Without Inlined sockets there is no necessity for them, and separate panels helped with organization better I thought.

Will separate panels for Input and Output sockets come back as well? Without Inlined sockets there is no necessity for them, and separate panels helped with organization better I thought.

@Nika-Kutsniashvili having separate panels for input and outputs make it harder to drag the sockets around from/to different panels. Having them all on the same list facilitates that.

@Nika-Kutsniashvili having separate panels for input and outputs make it harder to drag the sockets around from/to different panels. Having them all on the same list facilitates that.
Member

It seems like this patch contains many unrelated formatting changes.

It seems like this patch contains many unrelated formatting changes.
Lukas Tönne added 1 commit 2023-09-21 10:56:17 +02:00
Author
Member

It seems like this patch contains many unrelated formatting changes.

Sorry, recent system update broke all the clang-format stuff on my machine again ... and then gitea hides the file will all the bogus changes from the diff by default :/

> It seems like this patch contains many unrelated formatting changes. Sorry, recent system update broke all the clang-format stuff on my machine again ... and then gitea hides the file will all the bogus changes from the diff by default :/
Lukas Tönne added 1 commit 2023-09-21 11:06:49 +02:00
Lukas Tönne added 1 commit 2023-09-21 11:09:57 +02:00
ff85c97a1c Removed input_output API functions from node declarations.
These would now simply add an input and an output separately, but this
is not very useful.
Lukas Tönne added 1 commit 2023-09-22 11:34:15 +02:00
buildbot/vexp-code-patch-coordinator Build done. Details
a8f2f50df3
Merge branch 'main' into nodes-revert-inline-sockets
Author
Member

@blender-bot build

@blender-bot build
Jacques Lucke reviewed 2023-09-22 12:04:25 +02:00
@ -1234,1 +1234,4 @@
}
/* Convert sockets with both input and output flag into two separate sockets. */
FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
Member

This versioning code does break files that use the feature. Might be okay, but that should be an explicit decision that is also mentioned in the PR description.

Files break when the inlined interface sockets where linked to something else.

This versioning code does break files that use the feature. Might be okay, but that should be an explicit decision that is also mentioned in the PR description. Files break when the inlined interface sockets where linked to something else.
Author
Member

By "break files" i guess you mean it removes links? Because it may now generate a different identifier i guess. Could try and replicate what the socket identifiers would be to make that work.

By "break files" i guess you mean it removes links? Because it may now generate a different identifier i guess. Could try and replicate what the socket identifiers would be to make that work.
Author
Member

I've added an explanation as to why node links may get discarded and why we don't want to version that.

I've added an explanation as to why node links may get discarded and why we don't want to version that.
LukasTonne marked this conversation as resolved
@ -1235,0 +1236,4 @@
/* Convert sockets with both input and output flag into two separate sockets. */
FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
blender::Vector<bNodeTreeInterfaceSocket *> sockets_to_split;
ntree->tree_interface.foreach_item([&](bNodeTreeInterfaceItem &item) {
Member

Feels like it might be nice not to rely on code that may change too much in versioning, but to stay closer to the actual data. Should be fine for now, but this may have to be rewritten at some point if the called code changes.

Feels like it might be nice not to rely on code that may change too much in versioning, but to stay closer to the actual data. Should be fine for now, but this may have to be rewritten at some point if the called code changes.
Author
Member

I added copying code for sockets without blenkernel calls here now. The fact that we don't need ID user count managing makes this a whole lot simpler than in blenkernel, all socket default_value data can be MEM_dupalloc'd.

I added copying code for sockets without blenkernel calls here now. The fact that we don't need ID user count managing makes this a whole lot simpler than in blenkernel, all socket `default_value` data can be MEM_dupalloc'd.
LukasTonne marked this conversation as resolved
@ -1235,0 +1252,4 @@
bNodeTreeInterfacePanel *parent = ntree->tree_interface.find_item_parent(socket->item);
bNodeTreeInterfaceSocket *socket_copy = reinterpret_cast<bNodeTreeInterfaceSocket *>(
ntree->tree_interface.insert_item_copy(socket->item, parent, position + 1));
/* Original socket becomes output */
Member

And comments with dot.

And comments with dot.
LukasTonne marked this conversation as resolved
@ -255,3 +255,3 @@
if (parent == nullptr || parent == &root_panel) {
/* Panel is the root panel. */
return 0;
return root_panel.item_position(item);
Member

Is this a bug-fix that should be committed independently?

Is this a bug-fix that should be committed independently?
Author
Member

Yes, fixed separately #112714

Yes, fixed separately #112714
LukasTonne marked this conversation as resolved
Jacques Lucke approved these changes 2023-09-22 12:05:04 +02:00
Lukas Tönne added 1 commit 2023-09-22 12:20:00 +02:00
Lukas Tönne added 2 commits 2023-09-22 16:30:28 +02:00
Lukas Tönne added 1 commit 2023-09-22 16:56:28 +02:00
Lukas Tönne merged commit 354915cf3c into main 2023-09-22 16:57:06 +02:00
Lukas Tönne deleted branch nodes-revert-inline-sockets 2023-09-22 16:57:07 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
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 Assignees
5 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#112560
No description provided.