Fix #112233: Panel collapsed state should not hide socket links #112326

Merged
Lukas Tönne merged 3 commits from LukasTonne/blender:fix-collapsed-panel-link-drawing into main 2023-09-15 12:58:03 +02:00

3 Commits

Author SHA1 Message Date
Lukas Tönne 5d5293aaef Renamed node socket visibility functions.
The `is_visible` method does not consider panel state, a socket is
"visible" even when its parent panel is collapsed.
`is_visible` -> `is_visible_or_panel_collapsed`

The `is_icon_visible` method represents true visibility, so this becomes
the new `is_visible` method.
`is_icon_visible` -> `is_visible`
2023-09-15 11:56:35 +02:00
Lukas Tönne f96841e9b5 Merge branch 'main' into fix-collapsed-panel-link-drawing 2023-09-15 11:31:24 +02:00
Lukas Tönne 23443d1376 Fix #112233: Panel collapsed state should not hide socket links.
visibility calculation. This prevents dragging links, but also disables
other features that should still work, such as drawing links.

A narrower condition is needed for icon visibility vs. general socket
visibility. The cases which use the new condition are:
- Drawing socket selection outlines (same as unselected sockets)
- Drawing multi-input sockets (same as unselected sockets)
- `node_find_indicated_socket`, used by a wide range of mouse click
  operators, including the link-drag operator that was cause for
  #112019.

Cases using the original `is_visible` (true even if parent panel is
collapsed):
- `nodeLinkIsHidden` draws links only when at least one socket is
  visible.
- `node_update_basis`, sockets still added to layout even if icon isn't
  rendered.
- `node_update_hidden`, panels are ignored for "hidden" nodes, all
  sockets are rendered.
- `NODE_OT_link_make` operator for finding "best" sockets to connect.
- `node_link_viewer` finding sockets to connect to a viewer node.
- `get_main_socket` used for insert-on-links (find sockets to splice
  into) and some shader previews
- `node_gather_link_searches`, suggestions for adding a new node at the
  end of a link.
2023-09-13 14:06:43 +02:00