Page MenuHome

Fix T94413: Keep new group input sockets hidden when group input node has hidden sockets
Changes PlannedPublic

Authored by Leon Schittek (lone_noel) on Apr 2 2022, 9:09 PM.

Details

Summary

This patch improves working with multiple group input nodes,
by automatically hiding new node group input sockets on
group input nodes with hidden sockets.


Issue
When using the link drag search from any input socket there is a
"Group Input" entry, that automatically adds a new input to the group
interface and connects the link to a new group input node containing
only that socket. The idea is to decentralize where data can come into
the node tree to reduce the need for very long node links.
The issue with the current behavior is that, when adding sockets to the
interface they are added to all group input nodes. So even the group
input nodes that were created specifically to only function as an input
for one thing will get the new sockets.

Comparison

masterpatch

Diff Detail

Repository
rB Blender
Branch
fix-dont-unhide-group-extension-socket-on-update (branched from master)
Build Status
Buildable 23397
Build 23397: arc lint + arc unit

Event Timeline

Leon Schittek (lone_noel) requested review of this revision.Apr 2 2022, 9:09 PM
Leon Schittek (lone_noel) created this revision.
Leon Schittek (lone_noel) added projects: Nodes & Physics, Restricted Project.

Update to current state of master.

Leon Schittek (lone_noel) updated this revision to Diff 51803.EditedMay 24 2022, 6:56 PM
  • Unexpose the "Hide new sockets" option as it's more of an implementation detail.
  • Add a NODE_HIDE_UNUSED_SOCKETS flag to store the "hidden sockets" state of nodes.

Rather than using the custom1 member of the group input node to store the "hidden socket" state, I've attempted to make it more explicit by adding a NODE_HIDE_UNUSED_SOCKETS flag, even though it only really has an effect for group inputs.
I think it makes it more clear what is intended.

Going with this flag would also allow more changes to the way the "hide unused sockets" operator works - e.g. it wouldn't have to query all sockets of all the selected nodes anymore to see if it should hide/unhide them.
But I wanted to get some preliminary feedback on the general direction.

I incorporated the feedback by @Ludvik Koutny (rawalanche) in T94413 and I think the patch now displays the desired behavior without adding any user facing complexity.

I incorporated the feedback by @Ludvik Koutny (rawalanche) in T94413 and I think the patch now displays the desired behavior without adding any user facing complexity.

Thank you very much. This is great.

Update to current state of master.

Leon Schittek (lone_noel) retitled this revision from Fix: Improve workflow with multiple group inputs to Fix T94413: Keep new group input sockets hidden when group input node has hidden sockets.Aug 19 2022, 11:46 AM
Leon Schittek (lone_noel) edited the summary of this revision. (Show Details)

I think this is a good solution. And because it's a separate flag, we can tune when it's used or even expose it in the UI if we want.
Eventually, maybe we could rework how hidden/collapsed nodes look, which could end up making this redundant. But until then, I think this enough of an improvement that it's worth it.

Hm, I'm unsure I like the behavior. Looking at the second video it really feels like the new input should be added to the selected group input node.

source/blender/editors/space_node/node_edit.cc
1774

There is SET_FLAG_FROM_TEST that should simplify this.

  • Use SET_FLAG_FROM_TEST makro
  • Add new group input sockets to selected group input nodes
Leon Schittek (lone_noel) marked an inline comment as done.Aug 24 2022, 8:36 AM

Hm, I'm unsure I like the behavior. Looking at the second video it really feels like the new input should be added to the selected group input node.

I can see how that could be expected and updated it accordingly (video below). Or do you have more general concerns besides the selected group input node?


What I meant was that the new socket would only be added in the currently selected node. I can't really think of a use case where you'd want to add the new input in multiple places like that. Maybe we could add a visibility toggle in the Inputs list that indicates whether this input is shown in the currently selected Group Input. I don't find the current behavior super intuitive.

Leon Schittek (lone_noel) planned changes to this revision.Aug 24 2022, 8:13 PM

I don't find the current behavior super intuitive.

I see what you mean.
The behavior being a bit opaque was the reason I originally added the flag in the interface so there is at least some indication for the user what is happening.

What I meant was that the new socket would only be added in the currently selected node. I can't really think of a use case where you'd want to add the new input in multiple places like that.

True. When no group input is selected we could just add a new one with only that socket exposed. Or just display a warning, but that might be annoying.

Maybe we could add a visibility toggle in the Inputs list that indicates whether this input is shown in the currently selected Group Input.

I experimented with something similar for the "Node" tab in the side panel in D14530 and it looked pretty nice, but I guess the "Group" tab would make more sense for group inputs.

I'll try around for a bit.

Hi,

what happened to this patch? It could have made it into 3.3 and it has not made it even into 3.4. I am struggling with this heavily on daily basis. The fact node socket hiding doesn't work when adding new sockets makes usage of multiple group inputs (to keep the node trees clean and readable) very painful.