[Bf-blender-cvs] [738bcd8] fracture_modifier: fix: crash when removing FM, ob->derivedFinal can become NULL in this case

Martin Felke noreply at git.blender.org
Sun Mar 27 15:13:16 CEST 2016


Commit: 738bcd8a0cdf21b510f38adb504b30bad44586e9
Author: Martin Felke
Date:   Sun Mar 27 15:12:47 2016 +0200
Branches: fracture_modifier
https://developer.blender.org/rB738bcd8a0cdf21b510f38adb504b30bad44586e9

fix: crash when removing FM, ob->derivedFinal can become NULL in this case

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

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

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

diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index 80d8bf3..9e95113 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -1335,7 +1335,10 @@ static void rigidbody_validate_sim_object(RigidBodyWorld *rbw, Object *ob, bool
 		}
 
 		mat4_to_loc_quat(loc, rot, ob->obmat);
-		DM_mesh_boundbox(ob->derivedFinal, locbb, size);
+		if (ob->derivedFinal)
+			DM_mesh_boundbox(ob->derivedFinal, locbb, size);
+		else  //fallback
+			BKE_mesh_boundbox_calc((Mesh*)ob->data, locbb, size);
 		mul_v3_v3(size, ob->size);
 
 		rbo->physics_object = RB_body_new(rbo->physics_shape, loc, rot, false, 0.0f, 0.0f, 0.0f, 0.0f, size);




More information about the Bf-blender-cvs mailing list