diff options
author | Sergej Reich <sergej.reich@googlemail.com> | 2013-02-20 04:45:53 +0400 |
---|---|---|
committer | Sergej Reich <sergej.reich@googlemail.com> | 2013-02-20 04:45:53 +0400 |
commit | 2f0eec488c7c634a843aaaa0abdd33a4e131422b (patch) | |
tree | 6eb5b40cc154e7a0012f22619dca529b8af72874 /source/blender/blenkernel/intern | |
parent | 6adb526f31fb14d800861a85ea5e565932fae162 (diff) |
rigidbody: Properly handle constrained objects not having rigid bodies
This is a pretty rare case that can be triggered by switching rigid body
and constraint groups before simulation was validated.
Code checked for existing physics objects but was missing else block.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/rigidbody.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c index caa344f862e..c2fd6a9f54a 100644 --- a/source/blender/blenkernel/intern/rigidbody.c +++ b/source/blender/blenkernel/intern/rigidbody.c @@ -635,6 +635,9 @@ void BKE_rigidbody_validate_sim_constraint(RigidBodyWorld *rbw, Object *ob, shor break; } } + else { /* can't create constraint without both rigid bodies */ + return; + } RB_constraint_set_enabled(rbc->physics_constraint, rbc->flag & RBC_FLAG_ENABLED); |