diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-12-11 14:44:29 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-12-11 14:44:29 +0300 |
commit | d415b5c7b85b07ce4e30e4dbe33491df23202cdc (patch) | |
tree | 156f277a8b58cceff2d5422e7b84bf6a85c68bb0 /source/blender/blenloader | |
parent | 48225a4658764cb9d56e48c018bef7b266081744 (diff) |
Fix crash in do-versions after recent changes
No one can simply go into a datablock before it was linked.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 26 |
1 files changed, 14 insertions, 12 deletions
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)) { |