[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60445] branches/soc-2013-rigid_body_sim/ source/blender/blenkernel/intern/rigidbody.c: rigidbody: Try to use old collision shape if creating new one fails

Sergej Reich sergej.reich at googlemail.com
Mon Sep 30 16:40:03 CEST 2013


Revision: 60445
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60445
Author:   sergof
Date:     2013-09-30 14:40:03 +0000 (Mon, 30 Sep 2013)
Log Message:
-----------
rigidbody: Try to use old collision shape if creating new one fails

Switching to box in that case isn't very nice behaviour and should be
avoided if possible.

Modified Paths:
--------------
    branches/soc-2013-rigid_body_sim/source/blender/blenkernel/intern/rigidbody.c

Modified: branches/soc-2013-rigid_body_sim/source/blender/blenkernel/intern/rigidbody.c
===================================================================
--- branches/soc-2013-rigid_body_sim/source/blender/blenkernel/intern/rigidbody.c	2013-09-30 14:33:18 UTC (rev 60444)
+++ branches/soc-2013-rigid_body_sim/source/blender/blenkernel/intern/rigidbody.c	2013-09-30 14:40:03 UTC (rev 60445)
@@ -251,8 +251,6 @@
 		else {
 			dm = CDDM_from_mesh(ob->data, ob);
 		}
-
-		BLI_assert(dm != NULL); // RB_TODO need to make sure there's no case where deform derived mesh doesn't exist
 		mvert   = (dm) ? dm->getVertArray(dm) : NULL;
 		totvert = (dm) ? dm->getNumVerts(dm) : 0;
 	}
@@ -612,7 +610,8 @@
 		rbo->physics_shape = new_shape;
 		RB_shape_set_margin(rbo->physics_shape, RBO_GET_MARGIN(rbo));
 	}
-	else { /* otherwise fall back to box shape */
+	/* 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