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 <montagne29@wanadoo.fr>2019-02-18 18:39:01 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-02-18 19:16:33 +0300
commitb36f78abf402ba0c121be1a27248f239456139e3 (patch)
tree03f849743f12d3f3b3c2a9171eef67f572520fe8 /source/blender/blenloader/intern/blend_validate.c
parent4977321c5a4cb04b74dccd666727222317137a8b (diff)
ID management: use FOREACH_MAIN_ID in some places.
Diffstat (limited to 'source/blender/blenloader/intern/blend_validate.c')
-rw-r--r--source/blender/blenloader/intern/blend_validate.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/source/blender/blenloader/intern/blend_validate.c b/source/blender/blenloader/intern/blend_validate.c
index 2d074c02d0e..f36438417ba 100644
--- a/source/blender/blenloader/intern/blend_validate.c
+++ b/source/blender/blenloader/intern/blend_validate.c
@@ -149,30 +149,29 @@ bool BLO_main_validate_libraries(Main *bmain, ReportList *reports)
/** Check (and fix if needed) that shape key's 'from' pointer is valid. */
bool BLO_main_validate_shapekeys(Main *bmain, ReportList *reports)
{
+ ID *id;
bool is_valid = true;
BKE_main_lock(bmain);
- ListBase *lbarray[MAX_LIBARRAY];
- int i = set_listbasepointers(bmain, lbarray);
- while (i--) {
- for (ID *id = lbarray[i]->first; id != NULL; id = id->next) {
- if (!BKE_key_idtype_support(GS(id->name))) {
- break;
- }
- if (id->lib == NULL) {
- /* We assume lib data is valid... */
- Key *shapekey = BKE_key_from_id(id);
- if (shapekey != NULL && shapekey->from != id) {
- is_valid = false;
- BKE_reportf(reports, RPT_ERROR,
- "ID %s uses shapekey %s, but its 'from' pointer is invalid (%p), fixing...",
- id->name, shapekey->id.name, shapekey->from);
- shapekey->from = id;
- }
+ FOREACH_MAIN_ID_BEGIN(bmain, id)
+ {
+ if (!BKE_key_idtype_support(GS(id->name))) {
+ break;
+ }
+ if (id->lib == NULL) {
+ /* We assume lib data is valid... */
+ Key *shapekey = BKE_key_from_id(id);
+ if (shapekey != NULL && shapekey->from != id) {
+ is_valid = false;
+ BKE_reportf(reports, RPT_ERROR,
+ "ID %s uses shapekey %s, but its 'from' pointer is invalid (%p), fixing...",
+ id->name, shapekey->id.name, shapekey->from);
+ shapekey->from = id;
}
}
}
+ FOREACH_MAIN_ID_END;
BKE_main_unlock(bmain);