Fix #113014: Improved sorting to keep node group outputs above inputs #113060
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#113060
Loading…
Reference in New Issue
No description provided.
Delete Branch "LukasTonne/blender:node-group-socket-ordering"
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?
The position validation when manipulating node group items now includes
outputs..inputs order in addition to sockets..panels order. The method
for finding a valid position has been simplified, it's just a single
iteration of insertion sort.
Versioning has been added to ensure files from 4.0 alpha with
potentially unsorted sockets get re-sorted. This uses
std::stable_sort
so that sockets keep their relative order apart from the input/output
grouping.
@ -815,2 +810,3 @@
return pos;
/* Insertion sort for a single item. */
int test_pos = clamp_i(initial_pos, 0, items.size() - 1);
math::clamp<int>()
I'm never sure which version to use, haha. We have the old-school
CLAMP
macro, theclamp_i
thing, cycles might have its own, andstd::clamp
as well ...C++
BLI_math
with template is the better choose.@ -817,0 +811,4 @@
/* Insertion sort for a single item. */
int test_pos = clamp_i(initial_pos, 0, items.size() - 1);
/* Move upward until valid position found. */
while (test_pos > 0 && item_compare(item, *items[test_pos - 1])) {
The fewer stateful variables, the better.
I find my version easier to read, to be honest. It's a pretty small function, not like this is affecting other code.
I can't move this socket down anymore:
@ -986,1 +987,4 @@
static void versioning_node_group_sort_sockets_recursive(bNodeTreeInterfacePanel &panel)
{
const bool sockets_above_panels = !(panel.flag &
Feels like at this point in versioning code we can just assume this to be
false
since it was never allowed?@ -1631,2 +1673,4 @@
}
}
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 400, 32)) {
node that the version here has to be updated.