[Bf-blender-cvs] [60bce45b8a4] temp-fracture-modifier-2.8: crash fix attempt when adding / removing rigidbody worlds

Martin Felke noreply at git.blender.org
Sun Dec 9 22:15:32 CET 2018


Commit: 60bce45b8a45f2001f1e4f80190af19be803fc3e
Author: Martin Felke
Date:   Sun Dec 9 22:15:05 2018 +0100
Branches: temp-fracture-modifier-2.8
https://developer.blender.org/rB60bce45b8a45f2001f1e4f80190af19be803fc3e

crash fix attempt when adding / removing rigidbody worlds

still issues when appending FM objects, need to re-add rigidbodies and refracture

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

M	source/blender/blenkernel/intern/fracture.c
M	source/blender/blenkernel/intern/rigidbody.c

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

diff --git a/source/blender/blenkernel/intern/fracture.c b/source/blender/blenkernel/intern/fracture.c
index 3a4223d0c49..9a6df49bfd4 100644
--- a/source/blender/blenkernel/intern/fracture.c
+++ b/source/blender/blenkernel/intern/fracture.c
@@ -1313,7 +1313,7 @@ void BKE_fracture_clear_cache(FractureModifierData* fmd, Scene *scene)
 			mi->aves = MEM_callocN(sizeof (float) * 3 *frame, "mi->aves");
 			//mi->fractured = false;
 
-			if (!mi->rigidbody->shared->physics_object)
+			if (mi->rigidbody && !mi->rigidbody->shared->physics_object)
 			{
 				mi->rigidbody->flag |= (RBO_FLAG_NEEDS_VALIDATE | RBO_FLAG_NEEDS_RESHAPE);
 			}
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index e86b526ab14..0cfaa34f9da 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -1102,7 +1102,7 @@ void BKE_rigidbody_world_id_loop(RigidBodyWorld *rbw, RigidbodyWorldIDFunc func,
 
 	if (rbw->objects) {
 		int i;
-		int count = BLI_listbase_count(&rbw->group->gobject);
+		int count = rbw->group ? BLI_listbase_count(&rbw->group->gobject) : 0;
 		if (count != rbw->numbodies) {
 			rigidbody_update_ob_array(rbw);
 		}



More information about the Bf-blender-cvs mailing list