Commit: 4626ca47b940e7ac98288598f192c5f004f2f7c4
Author: Sybren A. Stüvel
Date:   Thu Jun 28 14:04:51 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB4626ca47b940e7ac98288598f192c5f004f2f7c4

Prevented depsgraph errors when RigidBody Constraint is incomplete

===================================================================

M       source/blender/depsgraph/intern/builder/deg_builder_relations.cc

===================================================================

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
                         */

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to