[Bf-blender-cvs] [d415b5c7b85] blender2.8: Fix crash in do-versions after recent changes

Sergey Sharybin noreply at git.blender.org
Tue Dec 11 12:45:21 CET 2018


Commit: d415b5c7b85b07ce4e30e4dbe33491df23202cdc
Author: Sergey Sharybin
Date:   Tue Dec 11 12:44:29 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBd415b5c7b85b07ce4e30e4dbe33491df23202cdc

Fix crash in do-versions after recent changes

No one can simply go into a datablock before it was linked.

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

M	source/blender/blenloader/intern/versioning_280.c

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

diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index abf7c280996..237e1387a4e 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -917,6 +917,20 @@ void do_versions_after_linking_280(Main *bmain)
 		}
 		BKE_paint_toolslots_init_from_main(bmain);
 	}
+
+	if (!MAIN_VERSION_ATLEAST(bmain, 280, 36)) {
+		/* Ensure we get valid rigidbody object/constraint data in relevant collections' objects. */
+		for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+			RigidBodyWorld *rbw = scene->rigidbody_world;
+
+			if (rbw == NULL) {
+				continue;
+			}
+
+			BKE_rigidbody_objects_collection_validate(scene, rbw);
+			BKE_rigidbody_constraints_collection_validate(scene, rbw);
+		}
+	}
 }
 
 /* NOTE: this version patch is intended for versions < 2.52.2, but was initially introduced in 2.27 already.
@@ -2489,18 +2503,6 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
 				dir[0] = -dir[0];
 			}
 		}
-
-		/* Ensure we get valid rigidbody object/constraint data in relevant collections' objects. */
-		for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
-			RigidBodyWorld *rbw = scene->rigidbody_world;
-
-			if (rbw == NULL) {
-				continue;
-			}
-
-			BKE_rigidbody_objects_collection_validate(scene, rbw);
-			BKE_rigidbody_constraints_collection_validate(scene, rbw);
-		}
 	}
 
 	if (!MAIN_VERSION_ATLEAST(bmain, 280, 37)) {



More information about the Bf-blender-cvs mailing list