Geometry Nodes: support renaming some sockets in the node directly #121945

Merged
Jacques Lucke merged 16 commits from JacquesLucke/blender:rename-menu-items-in-node into main 2024-05-30 10:41:16 +02:00
Member

This adds support for renaming some sockets in the node UI directly by Ctrl+Clicking on them. This is sometimes more convenient than going to the sidebar. It affects the Menu Switch and Bake node as well as the Simulation and Repeat zone.

Some related notes:

  • The Group Input and Group Output node are not yet supported, because it currently breaks the right-alignment on the Group Input node. I couldn't find a workaround for this yet.
  • Double-clicking on the socket name does not trigger renaming yet. This seems to be a deeper issue in the interface code.
  • The highlighting when hovering over sockets that can be renamed is very dim making it hard to see. Alternatives like drawing a box around the label when hovering it (like in list views) have been discussed but seem to be much more difficult to get to work.

Despite these limitations, it seems reasonable to add this already, as it shouldn't affect anyone negatively. The nodes still look like before.

image

This adds support for renaming some sockets in the node UI directly by Ctrl+Clicking on them. This is sometimes more convenient than going to the sidebar. It affects the Menu Switch and Bake node as well as the Simulation and Repeat zone. Some related notes: * The Group Input and Group Output node are not yet supported, because it currently breaks the right-alignment on the Group Input node. I couldn't find a workaround for this yet. * Double-clicking on the socket name does not trigger renaming yet. This seems to be a deeper issue in the interface code. * The highlighting when hovering over sockets that can be renamed is very dim making it hard to see. Alternatives like drawing a box around the label when hovering it (like in list views) have been discussed but seem to be much more difficult to get to work. Despite these limitations, it seems reasonable to add this already, as it shouldn't affect anyone negatively. The nodes still look like before. ![image](/attachments/46b625df-b601-4d1b-963b-7efed975286c)
Jacques Lucke added 10 commits 2024-05-18 15:31:29 +02:00
Jacques Lucke requested review from Hans Goudey 2024-05-18 15:40:06 +02:00
Hans Goudey requested changes 2024-05-20 01:27:18 +02:00
Dismissed
Hans Goudey left a comment
Member

Agreed with the reasoning. This is really nice already and further improvements will only make it better. I have one request about the code though.

Agreed with the reasoning. This is really nice already and further improvements will only make it better. I have one request about the code though.
@ -16,6 +16,8 @@
#include "DNA_node_types.h"
#include "RNA_access.hh"
Member

Could you structure this in a way that doesn't require including RNA_access.hh in this header? The RNA headers are quite large and generally unnecessary for users of this header. SocketNameRNA can probably be private?

Could you structure this in a way that doesn't require including `RNA_access.hh` in this header? The RNA headers are quite large and generally unnecessary for users of this header. `SocketNameRNA` can probably be private?
Author
Member

I changed it so that we only need to access RNA_types.hh. I think it's reasonable to be able to include the definition of PointerRNA in this header. It's such a core type in Blender. We could consider extracting a RNA_pointer.hh from RNA_types.hh that only contains this definition plus a few small helpers maybe.

I changed it so that we only need to access `RNA_types.hh`. I think it's reasonable to be able to include the definition of `PointerRNA` in this header. It's such a core type in Blender. We could consider extracting a `RNA_pointer.hh` from `RNA_types.hh` that only contains this definition plus a few small helpers maybe.
Jacques Lucke added 3 commits 2024-05-20 18:53:43 +02:00
Jacques Lucke requested review from Hans Goudey 2024-05-20 18:55:28 +02:00
First-time contributor

Love this addition thanks :)
I was just wondering why ctrl + click and not double click? Double click is more "known" imo

Love this addition thanks :) I was just wondering why ctrl + click and not double click? Double click is more "known" imo
Author
Member

@costa already mentioned that in the PR description. Would love to have double clicking, but it seems to be quite a bit more complex in current UI code to achieve (asked Julian about it already).

@costa already mentioned that in the PR description. Would love to have double clicking, but it seems to be quite a bit more complex in current UI code to achieve (asked Julian about it already).
Member

I noticed the text is moved to the right compared to the existing socket labels. I think it would be worth investigating keeping the alignment the same. I guess the UI code might have to be tweaked for non-embossed properties. A new button flag might be necessary too.

I noticed the text is moved to the right compared to the existing socket labels. I think it would be worth investigating keeping the alignment the same. I guess the UI code might have to be tweaked for non-embossed properties. A new button flag might be necessary too.
Hans Goudey added 2 commits 2024-05-29 18:27:16 +02:00
27b7f16349 Remove extra padding added for editable socket names
Just because these socket names are editable doesn't mean
the text padding should be different from other sockets
Hans Goudey approved these changes 2024-05-29 18:27:31 +02:00
Jacques Lucke added 1 commit 2024-05-30 10:07:37 +02:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
827e932bc2
Merge branch 'main' into rename-menu-items-in-node
Author
Member

@blender-bot build

@blender-bot build
Jacques Lucke merged commit cd5eb4aa03 into main 2024-05-30 10:41:16 +02:00
Jacques Lucke deleted branch rename-menu-items-in-node 2024-05-30 10:41:19 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser Project (Legacy)
Interest
Asset System
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
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#121945
No description provided.