Regression: Node Editor: Framed nodes are pasted with an offset #106097

Closed
opened 2023-03-24 11:51:13 +01:00 by Leon Schittek · 3 comments
Member

System Information
Operating system: macOS-11.6.5-x86_64-i386-64bit 64 Bits
Graphics card: Intel Iris OpenGL Engine Intel Inc. 4.1 INTEL-16.5.9

Blender Version
Broken: version: 3.6.0 Alpha, branch: main, commit date: 2023-03-23 23:11, hash: f7946b486b0f
Broken: version: 3.5.0 Beta, branch: blender-v3.5-release
Worked: 3.4.1

Caused by 7355d64f2b

Short description of error
Nodes that are contained inside a frame are pasted with an offset. This
offset accumulates the more levels of nesting there are.

The attached video shows the behavior with the attached blend file.

Exact steps for others to reproduce the error
With the attached .blend file:

  1. Open the file.
  2. Select all the nodes on the canvas and copy them with ctrl + C
  3. Move the cursor and paste the nodes with ctrl + V
  4. Result: The framed nodes will be placed with an offset compared to the cursor. The offset is larger the more frames are around a node.

From scratch:

  1. Open any node editor.
  2. Add a node and frame it using ctrl + J.
  3. Select the frame and the node it contains.
  4. Copy the selected nodes with ctrl + C.
  5. Move the cursor and paste the nodes with ctrl + V
  6. Result: The nodes will be placed with an offset compared to the cursor.
**System Information** Operating system: macOS-11.6.5-x86_64-i386-64bit 64 Bits Graphics card: Intel Iris OpenGL Engine Intel Inc. 4.1 INTEL-16.5.9 **Blender Version** Broken: version: 3.6.0 Alpha, branch: main, commit date: 2023-03-23 23:11, hash: `f7946b486b0f` Broken: version: 3.5.0 Beta, branch: blender-v3.5-release Worked: 3.4.1 Caused by 7355d64f2be5 **Short description of error** Nodes that are contained inside a frame are pasted with an offset. This offset accumulates the more levels of nesting there are. The attached video shows the behavior with the attached blend file. **Exact steps for others to reproduce the error** With the attached .blend file: 1. Open the file. 2. Select all the nodes on the canvas and copy them with `ctrl + C` 3. Move the cursor and paste the nodes with `ctrl + V` 4. **Result:** The framed nodes will be placed with an offset compared to the cursor. The offset is larger the more frames are around a node. From scratch: 1. Open any node editor. 2. Add a node and frame it using `ctrl + J`. 3. Select the frame and the node it contains. 4. Copy the selected nodes with `ctrl + C`. 5. Move the cursor and paste the nodes with `ctrl + V` 6. **Result:** The nodes will be placed with an offset compared to the cursor.
Leon Schittek added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-03-24 11:51:13 +01:00
Member

Can confirm, will check...

Can confirm, will check...
Philipp Oeser added
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-03-24 11:55:40 +01:00
Author
Member

@lichtwerk I also took a look but thought I'd report first since it might be time critical. I think this fixes it:

diff --git a/source/blender/editors/space_node/clipboard.cc b/source/blender/editors/space_node/clipboard.cc
index 95c1c25e343..177d3a45c4b 100644
--- a/source/blender/editors/space_node/clipboard.cc
+++ b/source/blender/editors/space_node/clipboard.cc
@@ -263,8 +263,11 @@ static int node_clipboard_paste_exec(bContext *C, wmOperator *op)
     const float2 offset = (mouse_location - center) / UI_DPI_FAC;
 
     for (bNode *new_node : node_map.values()) {
-      new_node->locx += offset.x;
-      new_node->locy += offset.y;
+      /* Skip the offset for parented nodes since the location is in parent space. */
+      if (new_node->parent == nullptr) {
+        new_node->locx += offset.x;
+        new_node->locy += offset.y;
+      }
     }
   }
 

Should I bother with a PR for the release branch?

@lichtwerk I also took a look but thought I'd report first since it might be time critical. I think this fixes it: ``` diff --git a/source/blender/editors/space_node/clipboard.cc b/source/blender/editors/space_node/clipboard.cc index 95c1c25e343..177d3a45c4b 100644 --- a/source/blender/editors/space_node/clipboard.cc +++ b/source/blender/editors/space_node/clipboard.cc @@ -263,8 +263,11 @@ static int node_clipboard_paste_exec(bContext *C, wmOperator *op) const float2 offset = (mouse_location - center) / UI_DPI_FAC; for (bNode *new_node : node_map.values()) { - new_node->locx += offset.x; - new_node->locy += offset.y; + /* Skip the offset for parented nodes since the location is in parent space. */ + if (new_node->parent == nullptr) { + new_node->locx += offset.x; + new_node->locy += offset.y; + } } } ``` Should I bother with a PR for the release branch?
Member

Should I bother with a PR for the release branch?

go for it (if it is considered low enough prio for 3.5, the PR can still be changed to go into main instead)

> Should I bother with a PR for the release branch? go for it (if it is considered low enough prio for 3.5, the PR can still be changed to go into main instead)
Philipp Oeser changed title from Node Editor: Framed nodes are pasted with an offset to Regression: Node Editor: Framed nodes are pasted with an offset 2023-03-24 12:19:20 +01:00
Philipp Oeser added
Module
Nodes & Physics
Priority
High
and removed
Priority
Normal
labels 2023-03-24 12:19:46 +01:00
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-03-24 12:48:10 +01:00
Sign in to join this conversation.
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
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#106097
No description provided.