Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-12-15 14:56:02 +0300
committerJulian Eisel <julian@blender.org>2020-12-15 19:03:49 +0300
commit7dc8db7cd135e7b26fccc1cc6728cac8b510de70 (patch)
tree4ebea18f6179c9406d0d6e4c0c6a9b310594e1d4 /source
parent9caeb9dfc7dfe8dcd6507a6b8dce5b98651b40ca (diff)
Fix failing assert when generating material preview
The `!BKE_previewimg_is_finished()` in `icon_preview_startjob_all_sizes()` would fail. Caused by 990bd9acf243ae. We have to be more picky about tagging previews as unfinished after file read. But we also have to consider files stored in old versions and set the unfinished tag as needed.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/icons.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/icons.cc b/source/blender/blenkernel/intern/icons.cc
index 4bd850094f0..48f5e11778c 100644
--- a/source/blender/blenkernel/intern/icons.cc
+++ b/source/blender/blenkernel/intern/icons.cc
@@ -659,8 +659,16 @@ void BKE_previewimg_blend_read(BlendDataReader *reader, PreviewImage *prv)
}
prv->gputexture[i] = NULL;
/* 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;
+ * loading. That could be smarter and check if there's a preview job running instead.
+ * If the preview is tagged as changed, it needs to be updated anyway, so don't remove the tag.
+ */
+ if ((prv->flag[i] & PRV_CHANGED) == 0) {
+ BKE_previewimg_finish(prv, i);
+ }
+ else {
+ /* Only for old files that didn't write the flag . */
+ prv->flag[i] |= PRV_UNFINISHED;
+ }
}
prv->icon_id = 0;
prv->tag = 0;