UI: Enable tooltips with description for shaders #119705

Merged
Brecht Van Lommel merged 2 commits from Bartosz-Kosiorek/blender:tooltip into main 2024-04-26 16:30:01 +02:00
Contributor

Generic tooltips for all shaders are defined in file:
https://projects.blender.org/blender/blender/src/branch/main//source/blender/nodes/NOD_static_types.h#L22

It is displayed during Adding new Shader.

Unfortunately when we are opening existing project, is it hard to analyse (for beginners), as there is no tooltips with describtion of the Shader.
This commit adds tooltips with shader description display for a shaders.

Generic tooltips for all shaders are defined in file: https://projects.blender.org/blender/blender/src/branch/main//source/blender/nodes/NOD_static_types.h#L22 It is displayed during Adding new Shader. Unfortunately when we are opening existing project, is it hard to analyse (for beginners), as there is no tooltips with describtion of the Shader. This commit adds tooltips with shader description display for a shaders.
Bartosz Kosiorek requested review from Brecht Van Lommel 2024-03-20 17:05:30 +01:00
Bartosz Kosiorek requested review from Hans Goudey 2024-03-20 17:05:42 +01:00
Bartosz Kosiorek changed title from UI: Enable tooltips for shaders to WIP: UI: Enable tooltips for shaders 2024-03-20 17:06:05 +01:00
Bartosz Kosiorek requested review from Lukas Tönne 2024-03-20 17:06:57 +01:00
Bartosz Kosiorek requested review from Weizhen Huang 2024-03-21 11:50:33 +01:00
Bartosz Kosiorek force-pushed tooltip from dfcd8a0d2a to 54e6a13e6d 2024-03-22 19:40:52 +01:00 Compare

I suggest to look at how sockets implement tooltips, see node_socket_add_tooltip_in_node_editor calling uiLayoutSetTooltipFunc

I suggest to look at how sockets implement tooltips, see `node_socket_add_tooltip_in_node_editor` calling `uiLayoutSetTooltipFunc`
Bartosz Kosiorek force-pushed tooltip from 54e6a13e6d to b90978166b 2024-04-22 22:24:09 +02:00 Compare
Bartosz Kosiorek changed title from WIP: UI: Enable tooltips for shaders to WIP: UI: Enable tooltips with description for shaders 2024-04-22 22:25:00 +02:00
Bartosz Kosiorek changed title from WIP: UI: Enable tooltips with description for shaders to UI: Enable tooltips with description for shaders 2024-04-22 22:26:27 +02:00
Author
Contributor

I was able to display tooltips by using UI_BTYPE_TAB instead of UI_BTYPE_LABEL.
It is working as I intended (see screenshot), including resizing and shade dragging.

Unfortunately the text is aligned at center.

The tooltips are created in function: UI_tooltip_create_from_button_or_extra_icon

I was able to display tooltips by using `UI_BTYPE_TAB` instead of `UI_BTYPE_LABEL`. It is working as I intended (see screenshot), including resizing and shade dragging. Unfortunately the text is aligned at center. The tooltips are created in function: `UI_tooltip_create_from_button_or_extra_icon`

Ok, but using the same mechanism as sockets is probably still the correct solution.

Ok, but using the same mechanism as sockets is probably still the correct solution.
Author
Contributor

Ok, but using the same mechanism as sockets is probably still the correct solution.

Unfortunately for Shader's socket, the tips are only displayed if mouse is over Socket button (like Color picker or variable picker).
If the Socket is without possible to customization (without button), the tip is not displayed.

See attached screenhot: The tooltip are displayed over Fac button. The tooltip over Shader Socket is not displayed at all.

> Ok, but using the same mechanism as sockets is probably still the correct solution. Unfortunately for Shader's socket, the tips are only displayed if mouse is over Socket button (like `Color picker` or `variable picker`). If the Socket is without possible to customization (without button), the tip is not displayed. See attached screenhot: The tooltip are displayed over `Fac` button. The tooltip over `Shader` Socket is not displayed at all.

Try latest main.

Try latest main.
Bartosz Kosiorek force-pushed tooltip from b90978166b to da43a39721 2024-04-24 09:04:19 +02:00 Compare
Bartosz Kosiorek force-pushed tooltip from da43a39721 to 70a049ac2b 2024-04-24 09:43:57 +02:00 Compare
Author
Contributor

I managed to implement it with UI_BTYPE_LABEL, and it is working perfectly fine. Thanks @brecht @mod_moder

Unfortunately, not all nodes have descriptions (Composite. Texture Nodes, etc.).
In next PR-s I would like to add descriptions to such nodes, and add warning/assertion if any node have empty description. I think it will improve quality of User Interface.

I managed to implement it with `UI_BTYPE_LABEL`, and it is working perfectly fine. Thanks @brecht @mod_moder Unfortunately, not all nodes have descriptions (Composite. Texture Nodes, etc.). In next PR-s I would like to add descriptions to such nodes, and add warning/assertion if any node have empty description. I think it will improve quality of User Interface.
Iliya Katushenock added this to the Nodes & Physics project 2024-04-24 11:25:38 +02:00
Iliya Katushenock added the
Interest
User Interface
label 2024-04-24 11:25:43 +02:00
Bartosz Kosiorek force-pushed tooltip from 70a049ac2b to f1a3d33670 2024-04-24 16:10:29 +02:00 Compare
Brecht Van Lommel added 1 commit 2024-04-26 16:22:10 +02:00
Brecht Van Lommel approved these changes 2024-04-26 16:24:15 +02:00
Brecht Van Lommel merged commit 749433f20b into main 2024-04-26 16:30:01 +02:00
Brecht Van Lommel deleted branch tooltip 2024-04-26 16:30:03 +02: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 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#119705
No description provided.