[Bf-blender-cvs] [303aceb917b] master: Fix asset previews not showing in "Current File" repository after reading

Julian Eisel noreply at git.blender.org
Tue Dec 15 17:04:35 CET 2020


Commit: 303aceb917b892e1144b88663225ee3b1e78eabe
Author: Julian Eisel
Date:   Mon Dec 14 15:19:09 2020 +0100
Branches: master
https://developer.blender.org/rB303aceb917b892e1144b88663225ee3b1e78eabe

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.

===================================================================

M	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;



More information about the Bf-blender-cvs mailing list