Fix crash in do-versions after recent changes
No one can simply go into a datablock before it was linked.
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user