Fix #112490: Always draw socket icons in "hidden" nodes #112520

Merged
Lukas Tönne merged 5 commits from LukasTonne/blender:fix-hidden-node-sockets-in-panels into main 2023-09-19 10:47:28 +02:00
Member

In #112326 the socket visibility functions were updated to take the
open/closed state of panels into account for visibility of the socket
icon. However, in "hidden" (collapsed) nodes the panels should be
ignored entirely, drawing all sockets on the root level. This requires
looking at the node flags to determine socket icon visibility, so a
simple method of bNodeSocket is not sufficient.

This patch moves the more complex visibility queries for sockets into
bNode, where both node and socket flags can be accessed. These should
be used for actual visibility rather than the plain flag accessors on
bNodeSocket.

Renamed is_visible_or_panel_closed back to just is_visible, the
other is_visible variant is now integrated in bNode::is_socket_drawn.

In #112326 the socket visibility functions were updated to take the open/closed state of panels into account for visibility of the socket icon. However, in "hidden" (collapsed) nodes the panels should be ignored entirely, drawing all sockets on the root level. This requires looking at the node flags to determine socket icon visibility, so a simple method of `bNodeSocket` is not sufficient. This patch moves the more complex visibility queries for sockets into `bNode`, where both node and socket flags can be accessed. These should be used for actual visibility rather than the plain flag accessors on `bNodeSocket`. Renamed `is_visible_or_panel_closed` back to just `is_visible`, the other `is_visible` variant is now integrated in `bNode::is_socket_drawn`.
Lukas Tönne added 2 commits 2023-09-18 13:48:07 +02:00
775de616cf Fix #112490: Always draw socket icons in "hidden" nodes.
In #112326 the socket visibility functions were updated to take the
open/closed state of panels into account for visibility of the socket
icon. However, in "hidden" (collapsed) nodes the panels should be
ignored entirely, drawing all sockets on the root level. This requires
looking at the node flags to determine socket icon visibility, so a
simple method of `bNodeSocket` is not sufficient.

This patch moves the more complex visibility queries for sockets into
`bNode`, where both node and socket flags can be accessed. These should
be used for actual visibility rather than the plain flag accessors on
`bNodeSocket`.
1a41124c85 Rename `is_visible_or_panel_closed` back to just `is_visible`.
The other `is_visible` variant is now integrated in
`bNode::is_socket_drawn`.
Lukas Tönne added this to the Nodes & Physics project 2023-09-18 13:48:14 +02:00
Lukas Tönne requested review from Hans Goudey 2023-09-18 13:48:34 +02:00
Hans Goudey approved these changes 2023-09-18 13:56:29 +02:00
@ -704,6 +704,15 @@ inline blender::Span<bNodeLink> bNode::internal_links() const
return this->runtime->internal_links;
}
inline bool bNode::is_socket_drawn(const bNodeSocket &socket) const{
Member

I'd suggest setting up your editor to format when you save the file :D

I'd suggest setting up your editor to format when you save the file :D
Author
Member

Looks like a recent qtcreator update changed the formatting settings, should be ok again now, will keep an eye on it.

Looks like a recent qtcreator update changed the formatting settings, should be ok again now, will keep an eye on it.
LukasTonne marked this conversation as resolved
@ -428,6 +427,9 @@ typedef struct bNode {
/** A span containing all internal links when the node is muted. */
blender::Span<bNodeLink> internal_links() const;
bool is_socket_drawn(const bNodeSocket &socket) const;
Member

From here it's hard to tell the difference between the two, deserves a comment IMO

From here it's hard to tell the difference between the two, deserves a comment IMO
LukasTonne marked this conversation as resolved
Lukas Tönne added 3 commits 2023-09-19 10:46:32 +02:00
Lukas Tönne merged commit 78315faf8f into main 2023-09-19 10:47:28 +02:00
Lukas Tönne deleted branch fix-hidden-node-sockets-in-panels 2023-09-19 10:47:29 +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
2 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#112520
No description provided.