Page MenuHome

UI Experiment: File Loading Preview
AbandonedPublic

Authored by Harley Acheson (harley) on Apr 4 2022, 1:14 AM.

Details

Reviewers
None
Group Reviewers
User Interface
Summary

When loading a new blend file, close open menus, show "waiting" cursor,
and display the preview thumbnail filling entire window.


This is an alternative to D10484: UI: File Loading Dialog. Instead of showing a "Loading" dialog it shows a blurred version of the thumbnail image across the entire window. It is especially pretty when you have set "File Preview Type" to "Screenshot" in Edit / Preferences / Save & Load:

Diff Detail

Repository
rB Blender

Event Timeline

Harley Acheson (harley) requested review of this revision.Apr 4 2022, 1:14 AM
Harley Acheson (harley) created this revision.
Harley Acheson (harley) retitled this revision from UI: File Loading Preview to UI Experiment: File Loading Preview.Apr 4 2022, 1:38 AM

Replacing gaussian code (of unknown license) with equivalent provided by @Lukas Stockner (lukasstockner97)

Also putting in a small dialog in the middle showing the file name and "Loading. Please wait...". It gives you something in focus to look at, rather than have entire window blurry.

Harley Acheson (harley) edited the summary of this revision. (Show Details)Apr 4 2022, 3:08 AM

Tested this, it's very slow on my system even with an optimized build (taking seconds just to show the preview for small files that would otherwise load instantly), showing a small image scaled up would be better to do on the GPU.

There is also memory leaking (from BLO_thumbnail_from_file).


A problem with this feature is fitting to the screen for different sized windows, either the image has the wrong aspect ratio (which will be OK for the window layout but not the content in the viewport), or the aspect needs to be kept with black-bars - which I think would be the way to go but is still rather awkward.

Suggest to handle this as a design task before going further with this.

Harley Acheson (harley) updated this revision to Diff 50088.EditedApr 4 2022, 9:56 PM
Harley Acheson (harley) edited the summary of this revision. (Show Details)

@Campbell Barton (campbellbarton) - it's very slow on my system even with an optimized build...

Yes, when initially making this I was using some blur code I found on github. But I couldn't find a license for it so swapped that out for code provided by @Lukas Stockner (lukasstockner97). Unfortunately that new code is 10X slower. So a process that was taking only 60ms was now taking 600ms. And I can see that taking a couple seconds (rather than 200ms) if you are on a high-dpi display.

This version no longer runs a gaussian blur at all so that code is removed and the result is instant. The blurring made it slightly prettier but is not worth the penalty.

There is also memory leaking (from BLO_thumbnail_from_file).

Interesting, will take a look.

A problem with this feature is fitting to the screen for different sized windows...

Not sure how much of a problem that would be in practice. Seeing a thumbnail at a funny ratio because you now have a different-sized layout than when you last saved? But yes, black bars could be added if they differ more than some threshold.

Suggest to handle this as a design task before going further with this.

For sure. Although I don't think I've noticed any UI design tasks reviewed or approved in quite a while. But this was just a pretty flourish anyway.

@Campbell Barton (campbellbarton) - There is also memory leaking (from BLO_thumbnail_from_file)...

Fixed. I was not freeing the returned data.