Node Editor: Improve working with frame nodes #106956

Open
opened 2023-04-14 16:22:06 +02:00 by Leon Schittek · 0 comments
Member

Problem

Working with frame nodes works well for most simple cases, but there are a few things that are confusing or cumbersome:

  • A node sitting on top of a frame is not necessarily part of the frame but there is no visual indication (example video)
  • Which frame a node is being added to during transform is based on the position of the mouse cursor and can lead to unexpected results (example video, also see issue #80218)
  • Nodes not being able to be removed from frames, slows down the workflow, since the user has to stop and explicitly detach the node

Proposal

After testing a few different variations for how this could work (together with users on the forums), this is what seemed to work best overall:

  1. Nodes should always be attached to the frames that include them
    • This reduces ambiguous situations, where nodes are on top of a frame without being part of it
    • This behavior is more predictable than the cursor based attachment logic we have now
  2. Allow detaching nodes during transform with a hotkey
    • Pressing Shift during transform to freely drag nodes out of a frame - even if "Shrink" is enabled (Shift is consistent with the re-parenting shortcut in the outliner)
  3. Allow adding/removing nodes from a frame by resizing it
  4. Additionally tweak node resizing, since it will be used more often:
    • Allow moving the frame during resizing by pressing Space (same as box selection, demovideo)
    • Improve hitzone for resizing to make it more accessible

Alternative: Remove "parenting"

The most promising alternative I tried was to remove parenting altogether. The premise was that frames simply always affect the nodes that are inside them.

What worked well:

  • No ambiguity about whether a node is inside a frame or not
  • Users seemed to like the ability to add nodes by resizing the frames itself (which has been included in the current proposal)

What didn't work:

  • Users didn't seem to like how multiple frames were able to affect one node at the same time:
    • In some situation it would lead to partially overlapping frames "stealing" nodes from one another
    • Overall users feared that it would be easy to create situations that are hard to untangle

Since "node stealing" is inherent to this approach, I settled on the proposed compromise that keeps the "one node, one frame" concept but reduces some of the quirqs.


Prototype Patch

A pull request implementing the proposed changes for testing can be found here: #105457


Steps for implementation

The prototype patch I've used for testing can be broken up into a few smaller changes:

  • Always add nodes to the frames they overlap
  • Improve resizing of nodes:
    • Hitzone for node resizing
    • Allow moving nodes during resizing
    • Respect snapping during resizing (I haven't actually implemented this in the prototype)

There are a few more things that are not required for this but might be nice:

  • Improve how the parenting of nodes to frames is propagated when deleting or grouping nodes.
  • Remove the "parent space" positioning of nodes so the node location is always in view space. I think this could also help removing the need for offsetx and offsety.
### Problem Working with frame nodes works well for most simple cases, but there are a few things that are confusing or cumbersome: * A node sitting on top of a frame is not necessarily part of the frame but there is no visual indication ([example video](/attachments/ee6a20e7-3ba5-4dfa-bd80-0cd8f3cdfa44)) * Which frame a node is being added to during transform is based on the position of the mouse cursor and can lead to unexpected results ([example video](/attachments/cea4b72b-2c03-491a-9c39-4598aceab366), also see issue #80218) * Nodes not being able to be removed from frames, slows down the workflow, since the user has to stop and explicitly detach the node ### Proposal After testing a few different variations for how this could work ([together with users on the forums](https://devtalk.blender.org/t/testing-wanted-for-joining-nodes-into-frames/28241)), this is what seemed to work best overall: 1. Nodes should always be attached to the frames that include them * This reduces ambiguous situations, where nodes are on top of a frame without being part of it * This behavior is more predictable than the cursor based attachment logic we have now 2. Allow detaching nodes during transform with a hotkey * Pressing `Shift` during transform to freely drag nodes out of a frame - even if "Shrink" is enabled (`Shift` is consistent with the re-parenting shortcut in the outliner) 3. Allow adding/removing nodes from a frame by resizing it 4. Additionally tweak node resizing, since it will be used more often: * Allow moving the frame during resizing by pressing `Space` (same as box selection, [demovideo](/attachments/1403aea9-c186-43d6-8d55-f4d796881003)) * Improve hitzone for resizing to make it more accessible ### Alternative: Remove "parenting" The most promising alternative I tried was to remove parenting altogether. The premise was that frames simply always affect the nodes that are inside them. **What worked well:** * No ambiguity about whether a node is inside a frame or not * Users seemed to like the ability to add nodes by resizing the frames itself (which has been included in the current proposal) **What didn't work:** * Users didn't seem to like how multiple frames were able to affect one node at the same time: * In some situation it would lead to partially overlapping frames "stealing" nodes from one another * Overall users feared that it would be easy to create situations that are hard to untangle Since "node stealing" is inherent to this approach, I settled on the proposed compromise that keeps the "one node, one frame" concept but reduces some of the quirqs. --- ### Prototype Patch A pull request implementing the proposed changes for testing can be found here: https://projects.blender.org/blender/blender/pulls/105457 --- ### Steps for implementation The prototype patch I've used for testing can be broken up into a few smaller changes: - [ ] Always add nodes to the frames they overlap - [ ] Improve resizing of nodes: - [x] Hitzone for node resizing - [ ] Allow moving nodes during resizing - [ ] Respect snapping during resizing (I haven't actually implemented this in the prototype) There are a few more things that are not required for this but might be nice: - Improve how the parenting of nodes to frames is propagated when deleting or grouping nodes. - Remove the "parent space" positioning of nodes so the node location is always in view space. I think this could also help removing the need for `offsetx` and `offsety`.
Leon Schittek added the
Type
Design
label 2023-04-14 16:22:07 +02:00
Leon Schittek added this to the Nodes & Physics project 2023-04-14 16:22:08 +02:00
Leon Schittek self-assigned this 2023-04-14 16:28:19 +02:00
Sign in to join this conversation.
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 Assignees
1 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#106956
No description provided.