diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-06-28 15:04:51 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-06-28 15:20:11 +0300 |
commit | 4626ca47b940e7ac98288598f192c5f004f2f7c4 (patch) | |
tree | 8c98542407801918669550e2987635608cf83ba4 /source | |
parent | 7ad0e8300db27459c0704376f9c73923b2cbc96f (diff) |
Prevented depsgraph errors when RigidBody Constraint is incomplete
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index fff83108ea1..f64c4f5aff0 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -1518,12 +1518,12 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) if (rbw->constraints) { FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(rbw->constraints, object) { - if (!object->rigidbody_constraint) { + RigidBodyCon *rbc = object->rigidbody_constraint; + if (rbc == NULL || rbc->ob1 == NULL || rbc->ob2 == NULL) { + /* When either ob1 or ob2 is NULL, the constraint doesn't work. */ continue; } - RigidBodyCon *rbc = object->rigidbody_constraint; - /* final result of the constraint object's transform controls how the * constraint affects the physics sim for these objects */ |