[Bf-blender-cvs] [6971bd9] master: Fix T43611: Collision shape of rigid bodies changes inadvertently

Sergey Sharybin noreply at git.blender.org
Tue Feb 10 08:56:38 CET 2015


Commit: 6971bd9a4fbb744386a5ab781172532d0aa4d4c6
Author: Sergey Sharybin
Date:   Tue Feb 10 12:49:34 2015 +0500
Branches: master
https://developer.blender.org/rB6971bd9a4fbb744386a5ab781172532d0aa4d4c6

Fix T43611: Collision shape of rigid bodies changes inadvertently

The issue was caused by the fix for T34108, which modified DNA in order to
get a fallback box collision shape. Not sue why it's needed, we can just get
box shape directly, without modifying user's settings.

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

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

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

diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index 3bf5c4c..aaf54b8 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -438,6 +438,10 @@ static void rigidbody_validate_sim_shape(Object *ob, bool rebuild)
 			new_shape = rigidbody_get_shape_trimesh_from_mesh(ob);
 			break;
 	}
+	/* use box shape if we can't fall back to old shape */
+	if (new_shape == NULL && rbo->physics_shape == NULL) {
+		new_shape = RB_shape_new_box(size[0], size[1], size[2]);
+	}
 	/* assign new collision shape if creation was successful */
 	if (new_shape) {
 		if (rbo->physics_shape)
@@ -445,11 +449,6 @@ static void rigidbody_validate_sim_shape(Object *ob, bool rebuild)
 		rbo->physics_shape = new_shape;
 		RB_shape_set_margin(rbo->physics_shape, RBO_GET_MARGIN(rbo));
 	}
-	/* use box shape if we can't fall back to old shape */
-	else if (rbo->physics_shape == NULL) {
-		rbo->shape = RB_SHAPE_BOX;
-		rigidbody_validate_sim_shape(ob, true);
-	}
 }
 
 /* --------------------- */




More information about the Bf-blender-cvs mailing list