UI: Move Auto-Offset toggle to User Preferences #111589

Merged
Hans Goudey merged 3 commits from Rawalanche/blender:node-auto-offset-userpref into main 2023-08-29 01:18:42 +02:00
Contributor

Moves Auto-Offset toggle from Node Editor View menu into Editing>Node Editor section of User Preferences.
image


Why?

Current implementation causes frustration, because:

  • Nodes being offset when adding a new one is clearly something that a given user either prefers to happen or not to happen. It's pretty much never circumstantial (based on type of scene or shader they are creating, or based or workspace they are in). Therefore it's clearly a User Preference.
  • The default behavior can not be changed. It is possible to go through every node editor in every workspace, disable Auto-Offset and then save Blender file as startup one, but the Auto-Offset will still be on for any new node editors user spawns during Blender session.
  • Users unaware of the default state resetting for new editors may unintentionally mess up their neatly organized node trees.
  • Users receiving files from someone else are also receiving their workflow preference setting.
  • If multiple users work on same Blender file, with different Auto-Offset state preference, they may be toggling it for each other causing unexpected behavior.
  • Probably no one will want this behavior to change between different instances of node editors, for example between workspaces, so user is forced to keep the state of the toggle manually in sync.
  • The per-editor setting was place in "View" menu, which clearly implies it should only contain settings concerning how the node tree is displayed/viewed, not how nodes are arranged when created.

Benefits:

  • Users can simply toggle it based on their preference, and never ever think about it again (unless they want to) as the value will persist between files and sessions.
  • The state defaults to ON, so the default behavior does not change.
  • The toggle in the User Preferences is right next to the related Auto-Offset Margin setting.
  • The View menu in Node Editor no longer contains toggle unrelated to Viewing operations.

Question for reviewers:
Plase double check I made the right changes in versioning_userdef.cc. That file is a bit confusing.

Moves Auto-Offset toggle from Node Editor View menu into Editing>Node Editor section of User Preferences. ![image](/attachments/a7c263b1-0239-47dd-aaaa-cc10de8d3b6e) ----- Why? ----- Current implementation causes frustration, because: - Nodes being offset when adding a new one is clearly something that a given user either prefers to happen or not to happen. It's pretty much never circumstantial (based on type of scene or shader they are creating, or based or workspace they are in). Therefore it's clearly a User Preference. - The default behavior can not be changed. It is possible to go through every node editor in every workspace, disable Auto-Offset and then save Blender file as startup one, but the Auto-Offset will still be on for any new node editors user spawns during Blender session. - Users unaware of the default state resetting for new editors may unintentionally mess up their neatly organized node trees. - Users receiving files from someone else are also receiving their workflow preference setting. - If multiple users work on same Blender file, with different Auto-Offset state preference, they may be toggling it for each other causing unexpected behavior. - Probably no one will want this behavior to change between different instances of node editors, for example between workspaces, so user is forced to keep the state of the toggle manually in sync. - The per-editor setting was place in "View" menu, which clearly implies it should only contain settings concerning how the node tree is displayed/viewed, not how nodes are arranged when created. Benefits: - Users can simply toggle it based on their preference, and never ever think about it again (unless they want to) as the value will persist between files and sessions. - The state defaults to ON, so the default behavior does not change. - The toggle in the User Preferences is right next to the related Auto-Offset Margin setting. - The View menu in Node Editor no longer contains toggle unrelated to Viewing operations. Question for reviewers: Plase double check I made the right changes in versioning_userdef.cc. That file is a bit confusing.
Ludvik Koutny added 1 commit 2023-08-27 16:59:52 +02:00
Iliya Katushenock added this to the Nodes & Physics project 2023-08-27 17:49:10 +02:00
Iliya Katushenock added the
Module
User Interface
label 2023-08-27 17:49:17 +02:00
First-time contributor

Well needed!

Well needed!
Leon Schittek added the
Interest
Nodes & Physics
label 2023-08-27 18:48:21 +02:00
Hans Goudey requested changes 2023-08-28 15:34:29 +02:00
Hans Goudey left a comment
Member

Thanks for the PR! The change makes sense, especially with your complete reasoning in the description. Just a few issues with the code to work out first.

Thanks for the PR! The change makes sense, especially with your complete reasoning in the description. Just a few issues with the code to work out first.
@ -854,6 +854,7 @@ void blo_do_versions_userdef(UserDef *userdef)
if (!USER_VERSION_ATLEAST(400, 18)) {
userdef->playback_fps_samples = 8;
userdef->uiflag &= ~(USER_NODE_AUTO_OFFSET);
Member

This should be moved to a new subversion bump, otherwise it may not run (it didn't for me). You can increase the file subversion in BKE_blend_version.h and move this to a new if check.

Also seems like this is resetting the flag, when it should be enabling it--
userdef->uiflag |= USER_NODE_AUTO_OFFSET; would enable the flag.

This should be moved to a new subversion bump, otherwise it may not run (it didn't for me). You can increase the file subversion in `BKE_blend_version.h` and move this to a new `if` check. Also seems like this is resetting the flag, when it should be enabling it-- `userdef->uiflag |= USER_NODE_AUTO_OFFSET;` would enable the flag.
Rawalanche marked this conversation as resolved
@ -1656,3 +1656,3 @@
SNODE_PIN = (1 << 12),
/** automatically offset following nodes in a chain on insertion */
SNODE_SKIP_INSOFFSET = (1 << 13),
SNODE_FLAG_UNUSED_12 = (1 << 13), /* cleared */
Member

"cleared" means that the flag has been reset by versioning in order for it to be used later. The comment can just be removed here I think.

"cleared" means that the flag has been reset by versioning in order for it to be used later. The comment can just be removed here I think.
Rawalanche marked this conversation as resolved
Ludvik Koutny added 1 commit 2023-08-28 16:11:36 +02:00
Ludvik Koutny added 1 commit 2023-08-28 16:30:50 +02:00
Ludvik Koutny requested review from Hans Goudey 2023-08-28 16:33:02 +02:00
Author
Contributor

Thanks for the PR! The change makes sense, especially with your complete reasoning in the description. Just a few issues with the code to work out first.

Thank you. I addressed your comments. I hope I did the subversion bump right. Let me know :)

> Thanks for the PR! The change makes sense, especially with your complete reasoning in the description. Just a few issues with the code to work out first. Thank you. I addressed your comments. I hope I did the subversion bump right. Let me know :)
Hans Goudey approved these changes 2023-08-28 16:35:07 +02:00
Hans Goudey left a comment
Member

Yes, great! I'll test this again before committing but accept it now, the code looks good.

Yes, great! I'll test this again before committing but accept it now, the code looks good.
Hans Goudey merged commit 411cd827b7 into main 2023-08-29 01:18:42 +02:00
Sign in to join this conversation.
No reviewers
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 Assignees
3 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#111589
No description provided.