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
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2021-11-24 13:20:35 +0300
committerJulian Eisel <julian@blender.org>2021-11-24 13:26:37 +0300
commit3850fdd5b957aa3b8f70d3c0b952b07af6b07fe1 (patch)
tree790b234b0d86f9c8494a1610a2728a3ff0c59da5 /source/blender/editors/util/ed_util_ops.cc
parent98a5658239bb61a701f20309c741ab895ed92b7a (diff)
Assets: Sanitize threaded preview creation with undo
Basically, this fixes disappearing previews when editing asset metadata or performing undo/redo actions. The preview generation in a background job will eventually modify ID data, but the undo push was done prior to that. So obviously, an undo then would mean the preview is lost. This patch makes it so undo/redo will regenerate the preview, if the preview rendering was invoked but not finished in the undone/redone state. The preview flag PRV_UNFINISHED wasn't entirely what we needed. So I had to change it to a slightly different flag, with different semantics.
Diffstat (limited to 'source/blender/editors/util/ed_util_ops.cc')
-rw-r--r--source/blender/editors/util/ed_util_ops.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/util/ed_util_ops.cc b/source/blender/editors/util/ed_util_ops.cc
index 7d32d252718..df6e093c57a 100644
--- a/source/blender/editors/util/ed_util_ops.cc
+++ b/source/blender/editors/util/ed_util_ops.cc
@@ -110,7 +110,7 @@ static void ED_OT_lib_id_load_custom_preview(wmOperatorType *ot)
ot->invoke = WM_operator_filesel;
/* flags */
- ot->flag = OPTYPE_INTERNAL;
+ ot->flag = OPTYPE_UNDO | OPTYPE_INTERNAL;
WM_operator_properties_filesel(ot,
FILE_TYPE_FOLDER | FILE_TYPE_IMAGE,