Fix ID preview not updating in Asset Browser

Fix ID preview not updating in Asset Browser, by actually sending an
explicit `NA_EDITED` along with the `NC_ASSET` notifier.
This commit is contained in:
Sybren A. Stüvel
2021-03-08 16:32:32 +01:00
parent a6a8ca9212
commit 6afe2d373a
2 changed files with 3 additions and 2 deletions

View File

@@ -459,6 +459,7 @@ static void file_listener(const wmSpaceTypeListenerParams *params)
break;
case NA_ADDED:
case NA_REMOVED:
case NA_EDITED:
if (sfile->files && filelist_needs_reset_on_main_changes(sfile->files)) {
/* Full refresh of the file list if local asset data was changed. Refreshing this view
* is cheap and users expect this to be updated immediately. */

View File

@@ -92,7 +92,7 @@ static int lib_id_load_custom_preview_exec(bContext *C, wmOperator *op)
BKE_previewimg_id_custom_set(id, path);
WM_event_add_notifier(C, NC_ASSET, nullptr);
WM_event_add_notifier(C, NC_ASSET | NA_EDITED, nullptr);
return OPERATOR_FINISHED;
}
@@ -133,7 +133,7 @@ static int lib_id_generate_preview_exec(bContext *C, wmOperator *UNUSED(op))
}
UI_icon_render_id(C, nullptr, id, ICON_SIZE_PREVIEW, true);
WM_event_add_notifier(C, NC_ASSET, nullptr);
WM_event_add_notifier(C, NC_ASSET | NA_EDITED, nullptr);
return OPERATOR_FINISHED;
}