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-01 14:58:33 +0300
committerJulian Eisel <julian@blender.org>2021-11-01 15:02:18 +0300
commitd5e343be2752afa34fcbcca235e2eddf46836ad5 (patch)
tree6861780cb4b996aa8e44ee84e5e36c771ac70a10
parent3df587b798a4dc33df0311ca3793f3c4aa441c72 (diff)
Fix T92593: Object preview not re-rendered after "Mark as Asset"
When using "Mark as Asset" the second time on an object (after having done a "Mark as Asset" and then a "Clear Asset"), the old preview would be re-used, even if the object was changed meanwhile. This is a bit of a papercut, so always force previews to be re-rendered on "Mark as Asset".
-rw-r--r--source/blender/editors/asset/intern/asset_mark_clear.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/editors/asset/intern/asset_mark_clear.cc b/source/blender/editors/asset/intern/asset_mark_clear.cc
index eb254dcd28b..a0a2c63b407 100644
--- a/source/blender/editors/asset/intern/asset_mark_clear.cc
+++ b/source/blender/editors/asset/intern/asset_mark_clear.cc
@@ -23,18 +23,17 @@
#include <memory>
#include <string>
+#include "DNA_ID.h"
+
#include "BKE_asset.h"
#include "BKE_context.h"
+#include "BKE_icons.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BLO_readfile.h"
-#include "DNA_ID.h"
-#include "DNA_asset_types.h"
-#include "DNA_space_types.h"
-
#include "UI_interface_icons.h"
#include "RNA_access.h"
@@ -66,6 +65,11 @@ bool ED_asset_mark_id(ID *id)
void ED_asset_generate_preview(const bContext *C, ID *id)
{
+ PreviewImage *preview = BKE_previewimg_id_get(id);
+ if (preview) {
+ BKE_previewimg_clear(preview);
+ }
+
UI_icon_render_id(C, nullptr, id, ICON_SIZE_PREVIEW, true);
}