From e2b1c70b487aa61f59d57fbde61df0ce30aded20 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 1 Jun 2017 15:04:22 +1000 Subject: [PATCH] Fix bad index use drawing deformed face centers --- source/blender/blenkernel/intern/editderivedmesh.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c index 5591ee2a0d4..4a45bf1534c 100644 --- a/source/blender/blenkernel/intern/editderivedmesh.c +++ b/source/blender/blenkernel/intern/editderivedmesh.c @@ -149,6 +149,8 @@ static void emDM_ensurePolyCenters(EditDerivedBMesh *bmdm) const float (*vertexCos)[3]; vertexCos = bmdm->vertexCos; + BM_mesh_elem_index_ensure(bm, BM_VERT); + BM_ITER_MESH_INDEX (efa, &fiter, bm, BM_FACES_OF_MESH, i) { BM_face_calc_center_mean_vcos(bm, efa, polyCos[i], vertexCos); }