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/bmesh/operators/bmo_subdivide.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/bmesh/operators/bmo_subdivide.c')
-rw-r--r-- | source/blender/bmesh/operators/bmo_subdivide.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c index 5032545af89..f9b6611c88b 100644 --- a/source/blender/bmesh/operators/bmo_subdivide.c +++ b/source/blender/bmesh/operators/bmo_subdivide.c @@ -225,8 +225,9 @@ static BMVert *subdivideedgenum(BMesh *bm, BMEdge *edge, BMEdge *oedge, BMVert *ev; float percent, percent2 = 0.0f; - if (BMO_elem_flag_test(bm, edge, EDGE_PERCENT) && totpoint == 1) - percent = BMO_slot_map_float_get(params->op->slots_in, "edgepercents", edge); + if (BMO_elem_flag_test(bm, edge, EDGE_PERCENT) && totpoint == 1) { + percent = BMO_slot_map_float_get(params->slot_edgepercents, edge); + } else { percent = 1.0f / (float)(totpoint + 1 - curpoint); percent2 = (float)(curpoint + 1) / (float)(totpoint + 1); @@ -778,6 +779,8 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op) params.numcuts = numcuts; params.op = op; + params.slot_edgepercents = BMO_slot_get(op->slots_in, "edgepercents"); + params.slot_custompatterns = BMO_slot_get(op->slots_in, "custompatterns"); params.smooth = smooth; params.seed = seed; params.fractal = fractal; @@ -837,7 +840,7 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op) } if (BMO_elem_flag_test(bm, face, FACE_CUSTOMFILL)) { - pat = BMO_slot_map_data_get(op->slots_in, "custompatterns", face); + pat = BMO_slot_map_data_get(params.slot_custompatterns, face); for (i = 0; i < pat->len; i++) { matched = 1; for (j = 0; j < pat->len; j++) { @@ -1159,6 +1162,7 @@ void bmo_bisect_edges_exec(BMesh *bm, BMOperator *op) params.numcuts = BMO_slot_int_get(op->slots_in, "cuts"); params.op = op; + params.slot_edgepercents = BMO_slot_get(op->slots_in, "edgepercents"); BM_data_layer_add(bm, &bm->vdata, CD_SHAPEKEY); skey = CustomData_number_of_layers(&bm->vdata, CD_SHAPEKEY) - 1; |