Files
test2/source/blender/editors/space_text
Jacques Lucke 5457cca3de Nodes: auto-hide unused inputs if usage depends on menu
Previously, when a socket was detected to be unused, it was just grayed out.
This patch adds support for automatically hiding unused sockets based on this
convention: Menu inputs control visibility while other inputs only control
whether something is grayed out.

More specifically, an input is visible if any of these conditions is met:
* It affects the output currently.
* It never affects the output. In this case its usage does not depend on any
  menu input.
* It is used if all non-menu inputs are considered to be unknown.

In the future, we could support customizing which inputs are allowed to control
visibility. For now it's good to use the convention that Blender generally
follows itself.

As before, panels are grayed out if they only contain grayed out sockets and
panels are hidden when they don't contain any visible sockets.

Hiding inputs works in group nodes, the Geometry Nodes modifier and node
operators. In theory it will work for all node tree types, but since only
Geometry Nodes supports the Menu Switch node currently, this patch currently
only makes a difference there.

The implementation reuses the existing `SocketUsageInferencer` with a different
sets of inputs. So no new core-inferencing logic was needed.

Design task: #132706.

Pull Request: https://projects.blender.org/blender/blender/pulls/138186
2025-05-22 04:48:43 +02:00
..