diff options
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/editmesh.c | 18 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/editmesh.c b/source/blender/blenkernel/intern/editmesh.c index 2247b91df1d..87a5c6f149f 100644 --- a/source/blender/blenkernel/intern/editmesh.c +++ b/source/blender/blenkernel/intern/editmesh.c @@ -246,3 +246,21 @@ void BKE_editmesh_color_ensure(BMEditMesh *em, const char htype) break; } } + +float (*BKE_editmesh_vertexCos_get_orco(BMEditMesh *em, int *r_numVerts))[3] +{ + BMIter iter; + BMVert *eve; + float (*orco)[3]; + int i; + + orco = MEM_mallocN(em->bm->totvert * sizeof(*orco), __func__); + + BM_ITER_MESH_INDEX (eve, &iter, em->bm, BM_VERTS_OF_MESH, i) { + copy_v3_v3(orco[i], eve->co); + } + + *r_numVerts = em->bm->totvert; + + return orco; +} diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 8ebc318ff9e..adce6e15732 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -1805,7 +1805,7 @@ void BKE_mesh_smooth_flag_set(Object *meshOb, int enableSmooth) * Return a newly MEM_malloc'd array of all the mesh vertex locations * \note \a r_numVerts may be NULL */ -float (*BKE_mesh_vertexCos_get(Mesh *me, int *r_numVerts))[3] +float (*BKE_mesh_vertexCos_get(const Mesh *me, int *r_numVerts))[3] { int i, numVerts = me->totvert; float (*cos)[3] = MEM_mallocN(sizeof(*cos) * numVerts, "vertexcos1"); |