Fix asset list not providing some previews
Fixes preview images not showing up in asset-view templates or the in development asset shelf. The sliding-window optimization to only load previews that are in view (or close to it) can't really be used by the asset-list API, since figuring out what's actually in view is a bit tricky. So we have to ensure all previews are loaded for now.
This commit is contained in:
@@ -218,9 +218,10 @@ void AssetList::ensurePreviewsJob(const bContext *C)
|
||||
int numfiles = filelist_files_ensure(files);
|
||||
|
||||
filelist_cache_previews_set(files, true);
|
||||
filelist_file_cache_slidingwindow_set(files, 128);
|
||||
/* TODO fetch all previews for now. */
|
||||
filelist_file_cache_block(files, numfiles / 2);
|
||||
/* Add one extra entry to ensure nothing is lost because of integer division. */
|
||||
filelist_file_cache_slidingwindow_set(files, numfiles / 2 + 1);
|
||||
filelist_file_cache_block(files, 0);
|
||||
filelist_cache_previews_update(files);
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user