UI: IDSearch Image Thumbnail Tooltips #118945

Merged
Harley Acheson merged 23 commits from Harley/blender:IDSearchImageThumbs into main 2024-06-08 22:42:09 +02:00
Member

Data-block ID selector showing Image thumbnails on hover.


image

image

image

Data-block ID selector showing Image thumbnails on hover. --- ![image](/attachments/bdafd212-40fb-4138-ad0c-987abc5dc67a) ![image](/attachments/fd5924c8-9b13-4ea1-865e-ce25b377f7fb) ![image](/attachments/870cced8-a62c-4153-80f8-5345c4403015)
Harley Acheson added 1 commit 2024-03-01 02:59:21 +01:00
Data-block ID selector showing Image thumbnails on hover.
Harley Acheson added this to the User Interface project 2024-03-01 02:59:54 +01:00
Member

This is great! I think it should show more info, the same as regular images does in the file browser. Since there can be multiple data-blocks with similar names (or the same name even, if linked) that point to different paths.

This is great! I think it should show more info, the same as regular images does in the file browser. Since there can be multiple data-blocks with similar names (or the same name even, if linked) that point to different paths.
Harley Acheson added 2 commits 2024-03-19 22:58:52 +01:00
Harley Acheson added 1 commit 2024-03-19 23:58:02 +01:00
Harley Acheson added 2 commits 2024-03-22 16:42:42 +01:00
Harley Acheson added 1 commit 2024-03-23 19:52:00 +01:00
Harley Acheson added 2 commits 2024-04-05 02:19:49 +02:00
Harley Acheson added 2 commits 2024-04-10 01:38:54 +02:00
Member

Thanks for tackling what we discussed in the module meeting.

I undertsand that since it's a data-block and not a "real" file, different data is available.

In that case some useful data-block specific info to show would be the "source" (single image, movie, etc) and color space. Is that possible?

image data-block

The resolution could also use the same format as in the Image panel (e.g. 400 x 400, RGB byte, SRGB8_A8)


IDSearchImageThumbs.gif

This is super nice, but since the example text is the font name, it makes it hard to compare how a specific character looks in different fonts. Would it be too bad/too long to go with something like "The quick brown fox jumps over the lazy dog"? :D I know some recommend against it but it is at least better for comparing characters.

Thanks for tackling what we discussed in the module meeting. I undertsand that since it's a data-block and not a "real" file, different data is available. In that case some useful data-block specific info to show would be the "source" (single image, movie, etc) and color space. Is that possible? ![image data-block](/attachments/3b39ea10-9bde-428e-8f2d-4162bf59cdce) The resolution could also use the same format as in the Image panel (e.g. `400 x 400, RGB byte, SRGB8_A8`) ---- > ![IDSearchImageThumbs.gif](/attachments/ecfcf2f7-4016-498f-814e-6c5b66d0e3b9) This is super nice, but since the example text is the font name, it makes it hard to compare how a specific character looks in different fonts. Would it be too bad/too long to go with something like ["The quick brown fox jumps over the lazy dog"](https://en.wikipedia.org/wiki/The_quick_brown_fox_jumps_over_the_lazy_dog)? :D I know some [recommend against it](https://www.typography.com/blog/text-for-proofing-fonts) but it is at least better for comparing characters.
Harley Acheson added 2 commits 2024-04-10 18:10:05 +02:00
Author
Member

@pablovazquez

I updated this PR and the captures in the first comment, showing number of users, image source, colorspace. And using a different sample type for the font.

@pablovazquez I updated this PR and the captures in the first comment, showing number of users, image source, colorspace. And using a different sample type for the font.
Harley Acheson added 1 commit 2024-04-28 23:20:58 +02:00
Member

Thanks for updating this PR!

Few notes:

  1. I get an instant crash when trying to preview a 32-bit float generated image (haven't tested non-generated though)
  2. Render Result shows empty color space
    Render Result
  3. Colorspace -> Color Space, but I don't think we actually need to specify, other labels don't and "sRGB" in context is easy to understand.

How about sorting it differently too:

mockup

  1. Path first. Close to the item name, since it's likely the longest item.
  2. Type, as it is now.
  3. Size. For videos would it be possible to have duration in frames at least? (image.frame_duration)
  4. Color space, without label.
  5. Users, with label otherwise it'd be just a floating number.
Thanks for updating this PR! Few notes: 1. I get an instant crash when trying to preview a 32-bit float generated image (haven't tested non-generated though) 2. Render Result shows empty color space ![Render Result](/attachments/c880d445-2139-424b-8e53-b2b29cc06dff) 3. `Colorspace` -> `Color Space`, but I don't think we actually need to specify, other labels don't and "sRGB" in context is easy to understand. How about sorting it differently too: ![mockup](/attachments/271e2363-7c90-458f-b25a-1978dc44d658) 1. Path first. Close to the item name, since it's likely the longest item. 2. Type, as it is now. 3. Size. For videos would it be possible to have duration in frames at least? (`image.frame_duration`) 4. Color space, without label. 5. Users, with label otherwise it'd be just a floating number.
Harley Acheson added 2 commits 2024-04-29 21:01:25 +02:00
Author
Member

@pablovazquez

  1. I get an instant crash when trying to preview a 32-bit float generated image (haven't tested non-generated though)

Fixed.

image

  1. Render Result shows empty color space

Yes, having difficulty getting anything from render result so far.

  1. Colorspace -> Color Space, but I don't think we actually need to specify, other labels don't and "sRGB" in context is easy to understand.

Perfect, removed it.

How about sorting it differently too:

Done. I updated the captures in the first comment.

Size. For videos would it be possible to have duration in frames at least?

Got it.

image

And while there also did the same for MoveClip, which is different from image of type movie:

image

@pablovazquez > 1. I get an instant crash when trying to preview a 32-bit float generated image (haven't tested non-generated though) Fixed. ![image](/attachments/80e04b28-df58-4108-984c-4ce141709aa9) > 2. Render Result shows empty color space Yes, having difficulty getting anything from render result so far. > 3. `Colorspace` -> `Color Space`, but I don't think we actually need to specify, other labels don't and "sRGB" in context is easy to understand. Perfect, removed it. > How about sorting it differently too: Done. I updated the captures in the first comment. > Size. For videos would it be possible to have duration in frames at least? Got it. ![image](/attachments/451ae1e0-0281-4c0d-9458-627a13b507b4) And while there also did the same for MoveClip, which is different from image of type movie: ![image](/attachments/dc376761-d320-4ba3-a3c7-bc829cfb105e)
Member

Awesome! What a nice improvement. Thanks!

No more notes from me looks wise. Looking forward to adding more of these useful tooltips elsewhere in the future.

Awesome! What a nice improvement. Thanks! No more notes from me looks wise. Looking forward to adding more of these useful tooltips elsewhere in the future.
Pablo Vazquez approved these changes 2024-04-29 22:40:45 +02:00
Author
Member

@HooglyBoogly - Any thoughts or ideas on how this could be done any better, neater, cleaner?

@HooglyBoogly - Any thoughts or ideas on how this could be done any better, neater, cleaner?
Harley Acheson changed title from UI Experiment: IDSearch Image Thumbnail Tooltips to UI: IDSearch Image Thumbnail Tooltips 2024-05-07 02:41:21 +02:00
Member

Any updates on this one? Would be great to get it in since there are other tooltip improvements in this release.

Any updates on this one? Would be great to get it in since there are other tooltip improvements in this release.
Author
Member

I think we ran the clock out on this one for 4.2...

The code makes more of a mess than I'd like considered this late in the release cycle. It could have been simplified by only only doing previews for images, but that would have just left users complaining that it didn't work for movies, etc. I think we should just make this a target for 4.3, see if @HooglyBoogly has any ideas about making less of a mess, and we can consider which types of items we want in this, if we need any more, how they look, etc

I think we ran the clock out on this one for 4.2... The code makes more of a mess than I'd like considered this late in the release cycle. It could have been simplified by only only doing previews for images, but that would have just left users complaining that it didn't work for movies, etc. I think we should just make this a target for 4.3, see if @HooglyBoogly has any ideas about making less of a mess, and we can consider which types of items we want in this, if we need any more, how they look, etc
Hans Goudey requested review from Hans Goudey 2024-06-04 19:51:23 +02:00
Hans Goudey requested changes 2024-06-05 15:52:09 +02:00
Dismissed
@ -156,0 +157,4 @@
* Return image buffer of preview for given image
* width_r & *height_r are optional and return the _original size_ of the image.
*/
struct ImBuf *BKE_image_preview(struct Image *ima, short max, short *width_r, short *height_r);
Member

Usually r_ is meant to be a prefix, is something different happening here? Also it's not clear what "max" means.

Usually `r_` is meant to be a prefix, is something different happening here? Also it's not clear what "max" means.
Harley marked this conversation as resolved
@ -4800,6 +4800,31 @@ bool BKE_image_has_ibuf(Image *ima, ImageUser *iuser)
return ibuf != nullptr;
}
ImBuf *BKE_image_preview(struct Image *ima, short max, short *width_r, short *height_r)
Member
  • struct Image -> Image
  • short max -> const short max
- `struct Image` -> `Image` - `short max` -> `const short max`
Harley marked this conversation as resolved
@ -4803,0 +4806,4 @@
ImBuf *image_ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
ImBuf *preview = nullptr;
if (image_ibuf) {
Member

Flip the condition and return early

Flip the condition and return early
Harley marked this conversation as resolved
@ -3302,12 +3302,8 @@ ARegion *UI_tooltip_create_from_gizmo(bContext *C, wmGizmo *gz);
void UI_tooltip_free(bContext *C, bScreen *screen, ARegion *region);
struct uiSearchItemTooltipData {
Member

This struct name doesn't really match what it contains anymore. It seems it only works for searches of ID data-blocks now. Is the struct even necessary actually? I'd expect the type to be redundant with the type information stored inside the ID.

This struct name doesn't really match what it contains anymore. It seems it only works for searches of ID data-blocks now. Is the struct even necessary actually? I'd expect the type to be redundant with the type information stored inside the ID.
Harley marked this conversation as resolved
@ -1502,23 +1508,196 @@ ARegion *UI_tooltip_create_from_gizmo(bContext *C, wmGizmo *gz)
return ui_tooltip_create_with_data(C, data, init_position, nullptr, aspect);
}
static void ui_tooltip_from_image(Image *ima, uiTooltipData *data)
Member

Use references instead of pointers

Use references instead of pointers
Harley marked this conversation as resolved
@ -1505,0 +1549,4 @@
}
if (BKE_image_has_anim(ima)) {
ImBufAnim *anim = ((ImageAnim *)ima->anims.first)->anim;
Member

Use C++ static_cast

Use C++ static_cast
Harley marked this conversation as resolved
@ -1505,2 +1664,3 @@
static uiTooltipData *ui_tooltip_data_from_search_item_tooltip_data(
const uiSearchItemTooltipData *item_tooltip_data)
bContext *C, const uiSearchItemTooltipData *item_tooltip_data)
Member

Unused argument? Anyway it's nice to not propagate context arguments this deep

Unused argument? Anyway it's nice to not propagate context arguments this deep
Harley marked this conversation as resolved
Harley Acheson added 2 commits 2024-06-05 19:42:37 +02:00
Author
Member

@HooglyBoogly - Is the struct even necessary actually? I'd expect the type to be redundant with the type information stored inside the ID

Yes, able to remove it. That does simplify things a bit. Thanks!

> @HooglyBoogly - Is the struct even necessary actually? I'd expect the type to be redundant with the type information stored inside the ID Yes, able to remove it. That does simplify things a bit. Thanks!
Harley Acheson added 1 commit 2024-06-05 20:09:05 +02:00
Hans Goudey approved these changes 2024-06-06 17:23:35 +02:00
First-time contributor

Could this somewhow still make it into 4.2? This would be so useful to have! Especially when trying to find images in the UV editor or shader editor, where the current thumbnails are way to small and sometimes the texuter names are just nonsensical. Also, the fact that is also shows meta data is such a time saver as well! ❤️

Could this somewhow still make it into 4.2? This would be so useful to have! Especially when trying to find images in the UV editor or shader editor, where the current thumbnails are way to small and sometimes the texuter names are just nonsensical. Also, the fact that is also shows meta data is such a time saver as well! ❤️
Author
Member

Could this somewhow still make it into 4.2? This would be so useful to have! Especially when trying to find images in the UV editor or shader editor, where the current thumbnails are way to small and sometimes the texuter names are just nonsensical. Also, the fact that is also shows meta data is such a time saver as well! ❤️

That's not impossible, but I think highly unlikely. We are quite strict about not introducing user-visible changes after we go into the Bcon3 stage of our release schedule.

> Could this somewhow still make it into 4.2? This would be so useful to have! Especially when trying to find images in the UV editor or shader editor, where the current thumbnails are way to small and sometimes the texuter names are just nonsensical. Also, the fact that is also shows meta data is such a time saver as well! ❤️ That's not impossible, but I think highly unlikely. We are quite strict about not introducing user-visible changes after we go into the Bcon3 stage of our release schedule.
Harley Acheson added 2 commits 2024-06-08 18:21:02 +02:00
comment change.
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
709814bda2
Author
Member

@blender-bot build

@blender-bot build
Harley Acheson added 1 commit 2024-06-08 18:55:58 +02:00
Harley Acheson added 1 commit 2024-06-08 21:34:59 +02:00
Merge branch 'main' of projects.blender.org:blender/blender into IDSearchImageThumbs
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
95f52f982e
Author
Member

@blender-bot build

@blender-bot build
Harley Acheson merged commit 8937c0bcab into main 2024-06-08 22:42:09 +02:00
Harley Acheson deleted branch IDSearchImageThumbs 2024-06-08 22:42:11 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
4 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#118945
No description provided.