[Bf-blender-cvs] [07355ff74ba] master: Fix mistake in previous commit.

Bastien Montagne noreply at git.blender.org
Mon Mar 18 11:42:53 CET 2019


Commit: 07355ff74baf08f4470748ff189e4367493d8758
Author: Bastien Montagne
Date:   Mon Mar 18 11:40:03 2019 +0100
Branches: master
https://developer.blender.org/rB07355ff74baf08f4470748ff189e4367493d8758

Fix mistake in previous commit.

===================================================================

M	source/blender/blenkernel/BKE_main.h
M	source/blender/blenloader/intern/blend_validate.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h
index 6b9c35d90d3..12aec58d2a5 100644
--- a/source/blender/blenkernel/BKE_main.h
+++ b/source/blender/blenkernel/BKE_main.h
@@ -169,7 +169,7 @@ struct GSet *BKE_main_gset_create(struct Main *bmain, struct GSet *gset);
 	{                                                                     \
 		ListBase *_lb;                                                    \
 		FOREACH_MAIN_LISTBASE_BEGIN(_bmain, _lb) {                        \
-			FOREACH_MAIN_LISTBASE_ID_BEGIN(_lbarray[_i], _id)
+			FOREACH_MAIN_LISTBASE_ID_BEGIN(_lb, _id)
 
 #define FOREACH_MAIN_ID_END                                               \
 			FOREACH_MAIN_LISTBASE_ID_END;                                 \
diff --git a/source/blender/blenloader/intern/blend_validate.c b/source/blender/blenloader/intern/blend_validate.c
index f36438417ba..cc0ce61ec15 100644
--- a/source/blender/blenloader/intern/blend_validate.c
+++ b/source/blender/blenloader/intern/blend_validate.c
@@ -149,29 +149,34 @@ 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)
 {
+	ListBase *lb;
 	ID *id;
 	bool is_valid = true;
 
 	BKE_main_lock(bmain);
 
-	FOREACH_MAIN_ID_BEGIN(bmain, id)
+	FOREACH_MAIN_LISTBASE_BEGIN(bmain, lb)
 	{
-		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_LISTBASE_ID_BEGIN(lb, 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_LISTBASE_ID_END;
 	}
-	FOREACH_MAIN_ID_END;
+	FOREACH_MAIN_LISTBASE_END;
 
 	BKE_main_unlock(bmain);



More information about the Bf-blender-cvs mailing list