diff options
author | Julian Eisel <julian@blender.org> | 2021-11-24 13:20:35 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-11-24 13:20:35 +0300 |
commit | cd818fd081f54dbb33ca8f994dd4d127ae79f883 (patch) | |
tree | d9dd442ba9b4257c5150b666eba97ed300b88f82 /source/blender/editors/include | |
parent | 785503a7e4d12fce8cab2b7d99456f40b2c3b1e2 (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/include')
-rw-r--r-- | source/blender/editors/include/ED_render.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/include/ED_render.h b/source/blender/editors/include/ED_render.h index 2d042b8b0e3..0e03000efba 100644 --- a/source/blender/editors/include/ED_render.h +++ b/source/blender/editors/include/ED_render.h @@ -41,6 +41,7 @@ struct bContext; struct bScreen; struct wmWindow; struct wmWindowManager; +enum eIconSizes; /* render_ops.c */ @@ -105,6 +106,11 @@ void ED_preview_icon_job(const struct bContext *C, int sizex, int sizey, const bool delay); + +void ED_preview_restart_queue_free(void); +void ED_preview_restart_queue_add(struct ID *id, enum eIconSizes size); +void ED_preview_restart_queue_work(const struct bContext *C); + void ED_preview_kill_jobs(struct wmWindowManager *wm, struct Main *bmain); void ED_preview_draw(const struct bContext *C, void *idp, void *parentp, void *slot, rcti *rect); |