Nodes: Use socket subtype in tooltip #120601

Open
Iliya Katushenock wants to merge 2 commits from mod_moder/blender:subtype_it_tooltip into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

Add subtype info into tooltips of node sockets. This reuse already existing code
to generate text from value, so this is trivial change. Now tooltip display the same
value as socket field itself.

Everywhere in examples values are different.

Float type:

None Percantage Factor Angle Time (Scene) Time (Absolute) Distance
image image image image image image image

Vector type:

None Translation Direction Velocity Acceleration Euler Angle XYZ
image image image image image image image

Integer type:

None Percantage Factor
image image image

Precision issue (#118073) it seems is not there due to now tooltip use the same function to generate the string as UI fields.
But this issue still should be taken into account to be fixed in future if we'll switch UI to fmt.
image

Add subtype info into tooltips of node sockets. This reuse already existing code to generate text from value, so this is trivial change. Now tooltip display the same value as socket field itself. Everywhere in examples values are different. Float type: | None | Percantage | Factor | Angle | Time (Scene) | Time (Absolute) | Distance | | -- | -- | -- | -- | -- | -- | -- | | ![image](/attachments/0b1c2f4a-2300-4953-a3ad-d2a66299b135) | ![image](/attachments/ce1086f6-c7f1-4998-900c-5e0741c72a56) | ![image](/attachments/a5525839-a864-4a33-bcae-5514395a88d9) | ![image](/attachments/d7c7db67-dfb2-455b-852f-32e284e59c75) | ![image](/attachments/2234eb90-2dfe-4225-b5fe-d4d442076d8e) | ![image](/attachments/12cde5fd-3cbe-4004-8c32-2d78759aff3b)| ![image](/attachments/3338b357-81c4-4634-8684-75b72873ffcb) | Vector type: | None | Translation | Direction | Velocity | Acceleration | Euler Angle | XYZ | | -- | -- | -- | -- | -- | -- | -- | | ![image](/attachments/4b104309-60ea-4b9a-a73c-64b21e58bb9c) | ![image](/attachments/c6bf98e5-82e2-4b14-84d3-6f1ae2fee5d8) | ![image](/attachments/1ce46fcd-81dd-4227-bea4-d88362caaed8) | ![image](/attachments/4ef3dfd2-ac75-431d-b28a-e2291c07741c) | ![image](/attachments/daf3cc06-db9e-415c-a00e-f3ac36386fad) | ![image](/attachments/321c8fef-eaae-4715-b1b5-e4f27d75e471) | ![image](/attachments/69d9ee5d-1729-4411-bd5b-89789e716751) | Integer type: | None | Percantage | Factor | | -- | -- | -- | | ![image](/attachments/e642d8cc-6209-4e9f-871b-7c7125bfb930) | ![image](/attachments/03b8ab38-f993-44b2-9d6a-5621046d43e7) | ![image](/attachments/e0d33a3d-51ee-4ed7-a924-daa9b53ab8f6) | Precision issue (#118073) it seems is not there due to now tooltip use the same function to generate the string as UI fields. But this issue still should be taken into account to be fixed in future if we'll switch UI to `fmt`. ![image](/attachments/427e2fe3-f904-4edf-8cc9-37f5630535dc)
Iliya Katushenock added 1 commit 2024-04-12 23:35:26 +02:00
Iliya Katushenock added 1 commit 2024-04-12 23:53:51 +02:00
Iliya Katushenock added this to the Nodes & Physics project 2024-04-13 00:14:53 +02:00
Iliya Katushenock added the
Module
User Interface
label 2024-04-13 00:14:57 +02:00
Member

I like showing the units in the tooltip, but I think the actual numerical value that Blender uses under the hood should still be displayed, as well. At least if it's different from the subtype value.

E.g. when it says 180 ° for the angle subtype it should still also mention that the actual value being passed around is 3.14...

I've seen people being confused by this and even just looking at the screenshot I'm unsure if 56.5 % means a value of 0.565 or 56.5.
So this might also help communicate that subtypes do more than just tag on a unit symbol at the end.

I like showing the units in the tooltip, but I think the actual numerical value that Blender uses under the hood should still be displayed, as well. At least if it's different from the subtype value. E.g. when it says `180 °` for the angle subtype it should still also mention that the actual value being passed around is `3.14...` I've seen people being confused by this and even just looking at the screenshot I'm unsure if `56.5 %` means a value of `0.565` or `56.5`. So this might also help communicate that subtypes do more than just tag on a unit symbol at the end.
Author
Member

I was thinking about 180 ° as reason why we need to display this instead of raw value. But i see issue with 56.5 %. So i think it should be okay if display 2 row with numbers, what do you think?

I was thinking about `180 °` as reason why we need to display this instead of raw value. But i see issue with `56.5 %`. So i think it should be okay if display 2 row with numbers, what do you think?
Member

So i think it should be okay if display 2 row with numbers, what do you think?

I think that could work.
Maybe dimming the second row could be a good idea. Otherwise I worry it could get too visually busy for long values like the acceleration vector.

Mockup:
tooltip_mockup.png

> So i think it should be okay if display 2 row with numbers, what do you think? I think that could work. Maybe dimming the second row could be a good idea. Otherwise I worry it could get too visually busy for long values like the acceleration vector. Mockup: ![tooltip_mockup.png](/attachments/7c86ae0d-0af7-4fca-bbe2-15298e074603)
Author
Member

I'll added support for such formatting of text in #121083.

I'll added support for such formatting of text in #121083.
This pull request has changes conflicting with the target branch.
  • source/blender/editors/space_node/node_draw.cc

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u subtype_it_tooltip:mod_moder-subtype_it_tooltip
git checkout mod_moder-subtype_it_tooltip
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
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#120601
No description provided.