Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergej Reich <sergej.reich@googlemail.com>2013-02-20 04:45:53 +0400
committerSergej Reich <sergej.reich@googlemail.com>2013-02-20 04:45:53 +0400
commit2f0eec488c7c634a843aaaa0abdd33a4e131422b (patch)
tree6eb5b40cc154e7a0012f22619dca529b8af72874 /source/blender/blenkernel/intern/rigidbody.c
parent6adb526f31fb14d800861a85ea5e565932fae162 (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/rigidbody.c')
-rw-r--r--source/blender/blenkernel/intern/rigidbody.c3
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);