From 303aceb917b892e1144b88663225ee3b1e78eabe Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Mon, 14 Dec 2020 15:19:09 +0100 Subject: Fix asset previews not showing in "Current File" repository after reading Previews would be flagged as unfinished when reading. Instead clear the flag and always consider them finished upon reading. If we wouldn't do this, the File Browser would keep running the preview updating to wait for the preview to finish. It could be smarter and also check if there's actually a preview job running. Instead, I think it will just display an unfilled buffer for now. Up until today we wouldn't even know if a stored preview is finished or not, so it would always assume they are finished. We do the same now, but have the option to make it smarter. --- source/blender/blenkernel/intern/icons.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern/icons.cc') diff --git a/source/blender/blenkernel/intern/icons.cc b/source/blender/blenkernel/intern/icons.cc index b92b2259eeb..4bd850094f0 100644 --- a/source/blender/blenkernel/intern/icons.cc +++ b/source/blender/blenkernel/intern/icons.cc @@ -658,7 +658,9 @@ void BKE_previewimg_blend_read(BlendDataReader *reader, PreviewImage *prv) BLO_read_data_address(reader, &prv->rect[i]); } prv->gputexture[i] = NULL; - prv->flag[i] |= PRV_UNFINISHED; + /* For now consider previews read from file as finished to not confuse File Browser preview + * loading. That could be smarter and check if there's a preview job running instead. */ + prv->flag[i] &= ~PRV_UNFINISHED; } prv->icon_id = 0; prv->tag = 0; -- cgit v1.2.3