From 2f0eec488c7c634a843aaaa0abdd33a4e131422b Mon Sep 17 00:00:00 2001 From: Sergej Reich Date: Wed, 20 Feb 2013 00:45:53 +0000 Subject: [PATCH] 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. --- source/blender/blenkernel/intern/rigidbody.c | 3 +++ 1 file changed, 3 insertions(+) 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);