Fix #104219: Node links are sometimes created from the wrong socket #104420
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#104420
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "HooglyBoogly:fix-node-editor-sort-socket-locations"
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?
For reasons described in more depth in the new code comment,
reordering nodes can sometimes invalidate the socket locations
in a way that makes random connections after a node is selected.
A better change would probably be to stop reordering nodes and
store their "UI order" separately instead, but that's more involved.
On its own, storing socket locations in a SoA format probably isn't
worth this complexity, but I think it's useful to have something like
this working so more data can be stored this way in the future.
I think the reproduce-ability of this bug depends on Blender's
performance, since I had a much easier time recreating it in a
debug build with a bunch of extra nodes added to the file.
@ -252,0 +260,4 @@
if (copy_socket_locations) {
ntree.ensure_topology_cache();
old_socket_indices.reserve(ntree.all_sockets().size());
for (const bNodeSocket *socket : ntree.all_sockets()) {
I think this could be implemented more efficiently (e.g. by storing something on
bNodeSocketRuntime
, or by only keeping track of the old node index which might work because the sockets of a node are consecutive inall_sockets()
).It's unlikely that this significantly impacts performance in practice though.
@ -174,3 +174,3 @@
* then the active node at the very end. Relative order is kept intact.
*/
void node_sort(bNodeTree &ntree);
void node_sort(SpaceNode &snode, bNodeTree &ntree);
This is problematic, because the tree might be visible in multiple node editors, all of which would have to be updated.
@ -153,0 +154,4 @@
/**
* The location of all sockets in the tree, calculated while drawing the nodes.
* Indexed with #bNodeSocket::index_in_tree().
This should mention which coordinate space is used.
Pull request closed