[Bf-blender-cvs] [135298a1a99] asset-browser-poselib: Fix missing refresh of Asset View UI template previews after regenerating
Julian Eisel
noreply at git.blender.org
Mon Apr 19 15:36:27 CEST 2021
Commit: 135298a1a990b77d33459e0927bb70360c613825
Author: Julian Eisel
Date: Mon Apr 19 15:32:47 2021 +0200
Branches: asset-browser-poselib
https://developer.blender.org/rB135298a1a990b77d33459e0927bb70360c613825
Fix missing refresh of Asset View UI template previews after regenerating
===================================================================
M source/blender/editors/asset/asset_list.cc
M source/blender/editors/include/ED_asset.h
M source/blender/editors/util/ed_util_ops.cc
===================================================================
diff --git a/source/blender/editors/asset/asset_list.cc b/source/blender/editors/asset/asset_list.cc
index 5cf150001f4..fdc67ef3aaa 100644
--- a/source/blender/editors/asset/asset_list.cc
+++ b/source/blender/editors/asset/asset_list.cc
@@ -314,7 +314,7 @@ bool AssetList::listen(const wmNotifier ¬ifier) const
if (ELEM(notifier.data, ND_ASSET_LIST, ND_ASSET_LIST_READING, ND_ASSET_LIST_PREVIEW)) {
return true;
}
- if (ELEM(notifier.action, NA_ADDED, NA_REMOVED)) {
+ if (ELEM(notifier.action, NA_ADDED, NA_REMOVED, NA_EDITED)) {
return true;
}
break;
diff --git a/source/blender/editors/include/ED_asset.h b/source/blender/editors/include/ED_asset.h
index 49e28407f0f..c642bc1c372 100644
--- a/source/blender/editors/include/ED_asset.h
+++ b/source/blender/editors/include/ED_asset.h
@@ -86,6 +86,9 @@ void ED_operatortypes_asset(void);
/* TODO move to C++ asset-list header? */
#ifdef __cplusplus
+
+# include <string>
+
std::string ED_assetlist_asset_filepath_get(const bContext *C,
const AssetLibraryReference &library_reference,
const AssetHandle &asset_handle);
diff --git a/source/blender/editors/util/ed_util_ops.cc b/source/blender/editors/util/ed_util_ops.cc
index 9b45545ed74..e2978e15565 100644
--- a/source/blender/editors/util/ed_util_ops.cc
+++ b/source/blender/editors/util/ed_util_ops.cc
@@ -39,6 +39,7 @@
#include "BLT_translation.h"
#include "ED_armature.h"
+#include "ED_asset.h"
#include "ED_render.h"
#include "ED_undo.h"
#include "ED_util.h"
@@ -140,6 +141,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 | NA_EDITED, nullptr);
+ ED_assetlist_storage_tag_main_data_dirty();
return OPERATOR_FINISHED;
}
More information about the Bf-blender-cvs
mailing list