Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-12-15 18:26:49 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-12-15 18:28:07 +0400
commit6ea13cf217e63b2db8f213b129dd2071da26af13 (patch)
treec9cc043290d453c6b71df5fca24bf3e6937bf938 /source/blender
parent2b0ba65c513b362617556551028360184f58ecc1 (diff)
Editmesh: skip allocating a face array for recalc-normals
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/bmesh/operators/bmo_normals.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/source/blender/bmesh/operators/bmo_normals.c b/source/blender/bmesh/operators/bmo_normals.c
index 1eaa0695ad2..7ad592411fc 100644
--- a/source/blender/bmesh/operators/bmo_normals.c
+++ b/source/blender/bmesh/operators/bmo_normals.c
@@ -148,8 +148,6 @@ static void bmo_recalc_face_normals_array(BMesh *bm, BMFace **faces, const int f
void bmo_recalc_face_normals_exec(BMesh *bm, BMOperator *op)
{
int *groups_array = MEM_mallocN(sizeof(*groups_array) * bm->totface, __func__);
- int faces_len;
- BMFace **faces_arr = BM_iter_as_arrayN(bm, BM_FACES_OF_MESH, NULL, &faces_len, NULL, 0);
BMFace **faces_grp = MEM_mallocN(sizeof(*faces_grp) * bm->totface, __func__);
int (*group_index)[2];
@@ -158,9 +156,10 @@ void bmo_recalc_face_normals_exec(BMesh *bm, BMOperator *op)
0, BM_EDGE);
int i;
-
BMO_slot_buffer_flag_enable(bm, op->slots_in, "faces", BM_FACE, FACE_FLAG);
+ BM_mesh_elem_table_ensure(bm, BM_FACE);
+
for (i = 0; i < group_tot; i++) {
const int fg_sta = group_index[i][0];
const int fg_len = group_index[i][1];
@@ -168,7 +167,7 @@ void bmo_recalc_face_normals_exec(BMesh *bm, BMOperator *op)
bool is_calc = false;
for (j = 0; j < fg_len; j++) {
- faces_grp[j] = faces_arr[groups_array[fg_sta + j]];
+ faces_grp[j] = BM_face_at_index(bm, groups_array[fg_sta + j]);
if (is_calc == false) {
is_calc = BMO_elem_flag_test_bool(bm, faces_grp[j], FACE_FLAG);
@@ -180,8 +179,6 @@ void bmo_recalc_face_normals_exec(BMesh *bm, BMOperator *op)
}
}
-
- if (faces_arr) MEM_freeN(faces_arr);
MEM_freeN(faces_grp);
MEM_freeN(groups_array);