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:
authorBastien Montagne <bastien@blender.org>2022-02-18 16:55:54 +0300
committerBastien Montagne <bastien@blender.org>2022-02-18 16:55:54 +0300
commitaf308049bc6d07e89ccf1e942a3a934453688be8 (patch)
treeb92d213c8dc618a5b1743c5c6a47775a768ab689 /source/blender/blenloader
parent5f16e24cc9ac4f620df2ab65d5a7b9ae4f99f203 (diff)
parent02f4d63dcc7b74fbacfb4e5bcdd01766563573f5 (diff)
Merge branch 'blender-v3.1-release'
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/blend_validate.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/blend_validate.c b/source/blender/blenloader/intern/blend_validate.c
index 10150f56098..e1527201e22 100644
--- a/source/blender/blenloader/intern/blend_validate.c
+++ b/source/blender/blenloader/intern/blend_validate.c
@@ -181,5 +181,20 @@ bool BLO_main_validate_shapekeys(Main *bmain, ReportList *reports)
BKE_main_unlock(bmain);
+ /* NOTE: #BKE_id_delete also locks `bmain`, so we need to do this loop outside of the lock here.
+ */
+ LISTBASE_FOREACH_MUTABLE (Key *, shapekey, &bmain->shapekeys) {
+ if (shapekey->from != NULL) {
+ continue;
+ }
+
+ BKE_reportf(reports,
+ RPT_ERROR,
+ "Shapekey %s has an invalid 'from' pointer (%p), it will be deleted",
+ shapekey->id.name,
+ shapekey->from);
+ BKE_id_delete(bmain, shapekey);
+ }
+
return is_valid;
}