Fix #103068: Link insert offset not working when rotating/scaling nodes #107460
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#107460
Loading…
Reference in New Issue
No description provided.
Delete Branch "lone_noel/blender:fix-103068-node-link-insert-offset"
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?
Fix node link insertion during transform not working properly for
rotation and scale.
Inserting nodes by rotating or scaling...
This commit fixes that by always calling the
NODE_OT_insert_offset
operator at the end of the node transform operator rather than having
to explicitly append it into a macro operator for each transform
operator.
Comparison
Note how in main the nodes are only offset when moving nodes after the
insertion happened. If this isn't done it causes unfreed memory.
Issue
Nodes can be inserted on links during transform. This is set up in
the transform operator for nodes (regardless of which type of
transform is used) by storing
NodeInsertOfsData
in the node space.This data is then used by the modal callback of the operator
NODE_OT_insert_offset
which handles moving the nodes out of the wayafter which the data is freed.
The issue is that
NODE_OT_insert_offset
is only invoked, when it isexplicitly put in an operator macro after the transform operators. This
has only been done for a few variants of the translate operator so
the link insertion offset is currently unhandled after rotating or
scaling nodes.
This leads to a few issues:
(The offset can still happen delayed when moving a node without
inserting it after the rotation/scaling, see [video])
node_relationships.cc
:BLI_assert(snode.runtime->iofsd == nullptr);
Proposed Fix
Rather than relying on the insert offset operator being chained after
each variation of the transform operator, this patch calls it in
special_aftertrans_update__node
, which removes the need to createmacro operators with
NODE_OT_insert_offset
.I'm not sure it's really necessary to keep
NODE_OT_insert_offset
around as an operator and it might not be necessary to store the
NodeInsertOfsData
in the node space anymore but this seems like aminimal fix for now.
Alternative
Another quick way to fix this is to just skip the rotation/scale
transform completely, when only one node is selected. Rotating/scaling
a single node doesn't do anything and since node link insertion only
works when transfoming a single node that would avoid the issues.
It would however come up again in case we wanted to enable link
insertion for multiple nodes (see D14185)
I guess at this point the fact that
NODE_OT_insert_offset
is an operator just gives us a simple way to make the timer work. That seems fine to me. I do agree thatNodeInsertOfsData
probably doesn't need to be stored in the editor's runtime data anymore. But that could be changed separately.Fix #103068: Link insert offset not working when rotating/scaling nodesto Fix #103068: Link insert offset not working when rotating/scaling nodesaba9b5ca32
tod90f3b3bfc