UI: Dynamic File Browser Tooltips #104547
No reviewers
Labels
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 project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#104547
Loading…
Reference in New Issue
No description provided.
Delete Branch "Harley/blender:FileTooltips"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Show tooltips in File Browser (both in thumbnail and list views) that
provide extra information and vary by type, like video resolution and
frames, etc.
I've proposed something similar a few years ago but this approach is radically different. File Browser no longer needs any knowledge about how to examine these files or create thumbnails. Information passed around only using thumbnail metadata for images and videos.
The thumbnail creation and storage method we use is a standard that includes storing textual data as well. And we currently do this for image dimensions - we just don't currently do anything with this information. This patch extends this process a bit further, storing details about images and videos in each preview's metadata.
Following shows hovering over an image and seeing dimensions:
Showing the version of Blender that saved this blend file. Note that it shows the full name, while it is truncated in the list.
Following shows seeing video details in a situation that wouldn't allow us to do it in any other way. The layout for "Video Editing" does not leave enough space to open up the side panels. Following shows details including dimensions, frames, and codec:
c757544344
toe70d751bfc
e70d751bfc
to48c1107a8a
48c1107a8a
tod6d405e43b
f089288d78
to06ac1631a0
06ac1631a0
to335bb75f30
@blender-bot build
Note to self. If we do something like this it would be nice to later alter the font previewing code so that we include a broad category name in the meta-data. So if I am guessing it is a symbol font, include "Symbol" in something that indicates broad intent. Same with languages obviously. This could also then allow for filtering by this or even showing in an optional column.
Harley Todo: This post includes information from Julian about how asset tooltips might look: #104693
b33c00e179
todbc5a923dd
dbc5a923dd
tof00e214162
WIP: UI: Dynamic File Browser Tooltipsto UI: Dynamic File Browser Tooltips4c6c06f2fe
toff2f9141de
This has been design approved by the UI Module, possibly with small tweaks to what is displayed (like number of file bytes, etc).
Does need code review.
@pablovazquez @brecht
It was brought up in UI Module meeting that these would be better if the filename were more prominent than the rest, perhaps bold while the rest is not and maybe include a small space to separate them.
However custom tooltips at the moment are just a single simple string. We don't currently have any fine control over the contents of tooltips.
I do have a WIP PR that allows extremely fine-grained control over tooltips. In fact allows you to construct them line-by-line, each with any color or style. And even allows images to be part of them if needed. So they could show a thumbnail in the tooltip when viewing files in list view, for example. #105905. I can update that PR if that sounds at all interesting.
Using that other PR makes sense to me.
If the extended information is muted like the Python tooltips that would already look fine I think. But there's multiple good ways this could be styled.
@ -116,0 +197,4 @@
!(file->attributes & FILE_ATTR_OFFLINE))
{
/* Load Blender version directly from the file. */
short version = BLO_version_from_file(full_path);
It's sightly suboptimal to open a file as part of tooltip drawing. On a slow network driver this could lead to a noticeable delay in display the tooltip when quickly scanning across multiple files quickly.
@ -1537,0 +1545,4 @@
IMB_metadata_set_field(ibuf->metadata, "Frames", value);
#ifdef WITH_FFMPEG
AVStream *v_st = anim->pFormatCtx->streams[anim->videoStream];
Can
anim->pFormatCtx
be null?Should this also check
anim->curtype == ANIM_FFMPEG
, since there are multiple types?@ -1537,0 +1553,4 @@
IMB_metadata_set_field(ibuf->metadata, "FPS", value);
SNPRINTF(value, "%g", duration);
IMB_metadata_set_field(ibuf->metadata, "Duration", value);
IMB_metadata_set_field(ibuf->metadata, "Codec", anim->pCodec->long_name);
If this metadata is specifically for thumbnails, it could use
Thumb::Image
for all the fields?@brecht
I changed it so all the video metadata is like "Thumb::Video::FPS", including width and height.
I improved it a bit, by having the blend thumbnails save with version in its metadata. That way we don't have to touch it if we have the thumbnail in our local cache. Although that makes me want to include other stats in there too now.
Seems fine to me now, but the file browser is more @JulianEisel 's area so I think this really needs a review from him too.
@pablovazquez
Do you mind taking at look at this and seeing anything looks funny? @JulianEisel is still going to have a quick look, but our hope is to get this in for 4.1
The
IMB_thumb_read()
&IMB_thumb_manage()
calls will load data from disk. This can cause Blender to freeze since they are called from the main thread. I'm not sure how much of an issue that would be in practice, but I would suggest to at least note this in comments. Besides that, files may already have loaded the image from disk, so it's better to access it from there. Seefilelist_file_getimage()
.@ -110,3 +116,2 @@
/* Dummy helper - we need dynamic tooltips here. */
static char *file_draw_tooltip_func(bContext * /*C*/, void *argN, const char * /*tip*/)
typedef struct file_tooltip_data {
@ -116,0 +138,4 @@
const FileDirEntry *file = file_data->file;
ImBuf *thumb = nullptr;
if (file->asset) {
I'd rather assert here, since when this is called, it would mean any asset tooltip callback was overridden by a file one.
@ -116,0 +190,4 @@
if (file->typeflag & (FILE_TYPE_BLENDER | FILE_TYPE_BLENDER_BACKUP))
{
char version_st[128] = {0};
thumb = IMB_thumb_read(full_path, THB_LARGE);
Why is this only using
_read()
, instead of_manage()
?In this case I don't want to create a new preview if one doesn't exist. Getting the version from the file is faster.
@ -116,0 +214,4 @@
}
}
else if (file->typeflag & FILE_TYPE_IMAGE) {
thumb = (file->attributes & FILE_ATTR_OFFLINE) ?
IMB_thumb_manage()
handles the case of offline files now, it won't attempt to generate those.@ -116,0 +235,4 @@
}
}
else if (file->typeflag & FILE_TYPE_MOVIE) {
thumb = (file->attributes & FILE_ATTR_OFFLINE) ?
Same here re offline file handling in
IMB_thumb_manage()
.Good idea. Thanks!
@JulianEisel
I updated this based on your feedback, trying to simplify and calm these a bit. I updated the captures in the first comment.
First I added a space before the date and size. This makes the custom information in the middle stand out a bit better.
I removed any labels that seemed obvious and redundant. So an image just shows "1024 x 768" without having "Dimensions: " in front of it. Similarly removed the colon for blend files so it shows "Blender 4.1" rather than "Blender: 4.1"
For the modified line it no longer shows the time unless it was saved today or yesterday. Seems less likely to need such precision further in the past.
It no longer shows the byte count unless it is under 10,000 bytes. So typical files will just show in Kb or Mb, etc.
@blender-bot build