Fix #106235: Use first link of multi-input socket for internal link #119280
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#119280
Loading…
Reference in New Issue
No description provided.
Delete Branch "mod_moder/blender:fix_multi_input_internal_links_all"
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?
Use first link of multi-input socket for internal link.
This requires to take into account:
@ -644,0 +651,4 @@
/* Multi-input index of link. */
const Span<const bNodeLink *> connected_links = input_socket->directly_linked_links();
const int index = std::distance(
Could just use a normal
for
loop over the connected links?I did that like that just to make index a const\
@ -644,0 +659,4 @@
}));
const int total_links = connected_links.size();
/* Legacy order requer inversion of index and use last index as default if there is no
These are not "legacy". We will still change the name from
index
tosort_id
but the values will stay the same.Reason why i don't like sort_id in the fact that order of sort_id is not explicit, and somewhere should be noted that order is reversed enumeration. How i should comment (if i should) the fact that i have to inverse index here?
That comment still has to be added to the dna property. I'm also fine with just using the exact same name that's used in dna for now.
@ -644,0 +661,4 @@
const int total_links = connected_links.size();
/* Legacy order requer inversion of index and use last index as default if there is no
* non-dangling connection. */
const int r_index = total_links - 1 - (index == total_links ? 0 : index);
Use the index stored in the connected link instead of trying to compute it here.
That is idea.
7f9915edac
to4fe8797e96
4fe8797e96
to448eab5bf3
@ -619,0 +619,4 @@
struct InternalLink {
bNodeSocket *from;
bNodeSocket *to;
int input_index = 0;
Call it
multi_input_socket_index
. It should be renamed at the same time when we renamebNodeLink::multi_input_socket_index
.@ -643,1 +660,4 @@
continue;
}
/* Multi-input index of link. */
This comment seems to be at the wrong line.
This comment is about all below lines, but i think now this one is just redundant.
@ -644,0 +665,4 @@
const bNodeLink *connected_link = first_non_dangling_link(ntree, connected_links);
const int index = connected_link ? connected_link->multi_input_socket_index :
math::max<int>(0, connected_links.size() - 1);
Can use
std::max
here. I also get a compile error withmath::max
, probably because of a missing include.@ -662,2 +679,2 @@
}
}
const bool skip = std::all_of(
skip
->all_expected_internal_links_exist
448eab5bf3
to1519dd0c9d