rigidbody: Fix [#34108] Rigid body with no polygons crashes blender

Fall back to using box shape in case creating shape from mesh fails.
This commit is contained in:
Sergej Reich 2013-02-04 23:50:36 +00:00
parent 9d8ec8b30f
commit ace88b6962

@ -416,6 +416,10 @@ void BKE_rigidbody_validate_sim_shape(Object *ob, short rebuild)
rbo->physics_shape = new_shape;
RB_shape_set_margin(rbo->physics_shape, RBO_GET_MARGIN(rbo));
}
else { /* otherwise fall back to box shape */
rbo->shape = RB_SHAPE_BOX;
BKE_rigidbody_validate_sim_shape(ob, true);
}
}
/* --------------------- */