Fix #106023: File Browser Lists with Incomplete Previews #107698
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#107698
Loading…
Reference in New Issue
No description provided.
Delete Branch "Harley/blender:ListPreviews"
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?
Ensure all File Browser list items get previews.
When we start creating a preview for a File Browser item we give it a FILE_ENTRY_PREVIEW_LOADING bit flag and we remove it when complete. This is done to make sure that multiple threads don't work on the same preview at the same time.
However there are MANY times when we clear the preview cache (filelist_cache_previews_clear) for a variety of reasons. When this happens any items that were in the cache queue retain their FILE_ENTRY_PREVIEW_LOADING flag. This means they won't be previewed if we try to add them to the queue again. This results in two types of bad behavior. The first is that given a list of items that have never been previewed, if you scroll while these are being created there might be some items that are never done and will remain showing a generic image icon. The second problem is if a folder contains more items than the cache size (usually 255 items) you might see some generic icons on either end of the list even if all items have been previewed.
This PR just checks for the state of a cleared cache (cache->previews_todo_count == 0) at the point of adding new items to the queue. If this is the case we remove that FILE_ENTRY_PREVIEW_LOADING bit flag since there is no good reason for it to be there at that time; it will only be there in error because the cache was cleared while it was in there.
I can confirm this PR does seem to fix the issue for my case. I was going to suggest that the flag be removed inside
filelist_cache_previews_clear
rather than where you did here, since that would make the most sense, but I don't see a way to do that?Yeah, me neither. I also looked at that and couldn't see a nice way to do this there while this PR is simple even if a little removed from the problem.
I also found a wonderful performance improvement if
filelist_file_cache_slidingwindow_set
is not allowed to makefilelist_cache.size
go below the initial value of FILELIST_ENTRYCACHESIZE_DEFAULT (1024). Mine is normally at 256 even though the intention is that it be between 256-8092. I'll probably post a PR for that but still thinking of how to sell it.This is indeed a quite random place to put this in, and I'm not sure how reliable it is.
This should be better:
Yes, a much better place to do this. Tested again, works great.
@blender-bot build