diff options
author | Sergej Reich <sergej.reich@googlemail.com> | 2013-07-04 12:52:24 +0400 |
---|---|---|
committer | Sergej Reich <sergej.reich@googlemail.com> | 2013-07-04 12:52:24 +0400 |
commit | 734e49ade664cf02ec5aa6764300afb1bf52dec4 (patch) | |
tree | 1fc20c4afe5c3f0a5530f91b973325a63eae11e2 /source/blender/blenkernel/intern/rigidbody.c | |
parent | 5fc8393deea9d41ce09de3f09021d9bc6835812d (diff) |
rigidbody: Remove constraint when removing one of it's objects
This is not the nicest behaviour but trying to keep both bullet and
blender side objects in sync breaks in this case.
There might be a better soluion but this avoids crashes for now.
Fixes: [#35995] Delete crash on specific scene (Physics)
Diffstat (limited to 'source/blender/blenkernel/intern/rigidbody.c')
-rw-r--r-- | source/blender/blenkernel/intern/rigidbody.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c index 9ddf0cd2d68..2675016bc4c 100644 --- a/source/blender/blenkernel/intern/rigidbody.c +++ b/source/blender/blenkernel/intern/rigidbody.c @@ -914,12 +914,10 @@ void BKE_rigidbody_remove_object(Scene *scene, Object *ob) if (obt && obt->rigidbody_constraint) { rbc = obt->rigidbody_constraint; if (rbc->ob1 == ob) { - rbc->ob1 = NULL; - rbc->flag |= RBC_FLAG_NEEDS_VALIDATE; + BKE_rigidbody_remove_constraint(scene, obt); } if (rbc->ob2 == ob) { - rbc->ob2 = NULL; - rbc->flag |= RBC_FLAG_NEEDS_VALIDATE; + BKE_rigidbody_remove_constraint(scene, obt); } } } |