Fix #112439: Don't hide sockets of Reroute node #112447
No reviewers
Labels
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 project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#112447
Loading…
Reference in New Issue
No description provided.
Delete Branch "mod_moder:tmp_fix_dont_hide_rerout"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Reroute node consists only of a socket, it has no body.
Don't allow hiding sockets of reroutes anymore, since it could make the
node invisible or prevent links from being connected to it.
The versioning ensures that the sockets on reroute nodes are not hidden.
Hi, thanks for looking into this.
Right now this fix has a few issues, since the
is_visible()
method is used in quite a few more places than just drawing the sockets.E.g.
node_find_indicated_socket
ignores hidden sockets, so if you hide a socket of a reroute, it will be drawn, but you can't connect to it - with no indication why.To me it seems safer to either (a.) change
is_visible()
itself to include the specific check for reroute nodes (and also check for any other uses ofSOCK_HIDDEN
that might cause trouble) or (b.) adjust the hide sockets operator so reroute sockets can't be hidden.The latter seems more correct to me, but it leaves the possibility for scripts and add-ons to still hide reroute sockets so they all have to handle this edge case by themselves.
Haven't been able to actually test this, yet, but this makes sense to me in general - a bit unsure about the changes to the RNA setter since I'm not very familiar with that.
@ -1189,0 +1191,4 @@
LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
if (node->is_reroute()) {
blender::bke::node_find_enabled_input_socket(*node, "Input")->flag &= ~SOCK_HIDDEN;
I think this should also un-hide the output socket.
While it's not actually drawn, it being hidden could cause links being unable to connect to it like mentioned before.
Works great now, thanks! Looks good to me aside from maybe that one comment.
I also smoothed over the phrasing of the PR description/commit message a bit - hope you don't mind.
I'd still like someone from the module to have a look.
@ -1354,2 +1354,4 @@
}
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 400, 25)) {
/* Convert sockets with both input and output flag into two separate sockets. */
The previous phrasing
/* Unhide all Reroute nodes. */
seemed clearer to me. I have to admit I'm not quite sure what this comment is saying.This was my mistake, this comment from above code block.
@ -1357,0 +1359,4 @@
FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
if (node->is_reroute()) {
blender::bke::node_find_enabled_input_socket(*node, "Input")->flag &= ~SOCK_HIDDEN;
I think it's clearer to just use
static_cast<bNodeSocket *>(node->inputs.first)
here rather then tying this behavior to a bkenkernel function unnecessarily.#112965
Pull request closed