diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-11-20 17:29:27 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-11-20 17:29:27 +0400 |
commit | ebaf1306b8167ea28be61980305a53b3c54cc4dc (patch) | |
tree | c4bcb52ec0fbc33d72e88bffd8df63f65155c377 /source/blender/modifiers/intern/MOD_skin.c | |
parent | 1dd5a89c87563d077f016fc38894c5195f6f03b0 (diff) |
bmesh operator api:
avoid per vert/edge/face string lookups in BMO_slot_map_* functions --- used in array modifier, subdivide, remove doubles and other tools.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_skin.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_skin.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c index 5e6c178762a..9f702957fa5 100644 --- a/source/blender/modifiers/intern/MOD_skin.c +++ b/source/blender/modifiers/intern/MOD_skin.c @@ -1080,17 +1080,20 @@ static BMFace *collapse_face_corners(BMesh *bm, BMFace *f, int n, BMOperator op; BMIter iter; int i; + BMOpSlot *slot_targetmap; shortest_edge = BM_face_find_shortest_loop(f)->e; BMO_op_initf(bm, &op, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE), "weld_verts"); + slot_targetmap = BMO_slot_get(op.slots_in, "targetmap"); + /* Note: could probably calculate merges in one go to be * faster */ v_safe = shortest_edge->v1; v_merge = shortest_edge->v2; mid_v3_v3v3(v_safe->co, v_safe->co, v_merge->co); - BMO_slot_map_ptr_insert(&op, op.slots_in, "targetmap", v_merge, v_safe); + BMO_slot_map_ptr_insert(&op, slot_targetmap, v_merge, v_safe); BMO_op_exec(bm, &op); BMO_op_finish(bm, &op); @@ -1216,6 +1219,7 @@ static void skin_fix_hole_no_good_verts(BMesh *bm, Frame *frame, BMFace *split_f BMOIter oiter; BMOperator op; int i, best_order[4]; + BMOpSlot *slot_targetmap; BLI_assert(split_face->len >= 3); @@ -1281,8 +1285,9 @@ static void skin_fix_hole_no_good_verts(BMesh *bm, Frame *frame, BMFace *split_f BM_face_kill(bm, split_face); BMO_op_init(bm, &op, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE), "weld_verts"); + slot_targetmap = BMO_slot_get(op.slots_in, "targetmap"); for (i = 0; i < 4; i++) { - BMO_slot_map_ptr_insert(&op, op.slots_in, "targetmap", + BMO_slot_map_ptr_insert(&op, slot_targetmap, verts[i], frame->verts[best_order[i]]); } BMO_op_exec(bm, &op); |