Changeset View
Changeset View
Standalone View
Standalone View
source/blender/bmesh/operators/bmo_subdivide.c
| Show First 20 Lines • Show All 1,357 Lines • ▼ Show 20 Lines | void bmo_bisect_edges_exec(BMesh *bm, BMOperator *op) | ||||
| params.numcuts = BMO_slot_int_get(op->slots_in, "cuts"); | params.numcuts = BMO_slot_int_get(op->slots_in, "cuts"); | ||||
| params.op = op; | params.op = op; | ||||
| params.slot_edge_percents = BMO_slot_get(op->slots_in, "edge_percents"); | params.slot_edge_percents = BMO_slot_get(op->slots_in, "edge_percents"); | ||||
| BM_data_layer_add(bm, &bm->vdata, CD_SHAPEKEY); | BM_data_layer_add(bm, &bm->vdata, CD_SHAPEKEY); | ||||
| bmo_subd_init_shape_info(bm, ¶ms); | bmo_subd_init_shape_info(bm, ¶ms); | ||||
| /* tag edges in map */ | |||||
| BMO_slot_map_to_flag(bm, op->slots_in, "edge_percents", BM_EDGE, EDGE_PERCENT); | |||||
| /* go through and split edges */ | /* go through and split edges */ | ||||
| BMO_ITER (e, &siter, op->slots_in, "edges", BM_EDGE) { | BMO_ITER (e, &siter, op->slots_in, "edges", BM_EDGE) { | ||||
| bm_subdivide_multicut(bm, e, ¶ms, e->v1, e->v2); | bm_subdivide_multicut(bm, e, ¶ms, e->v1, e->v2); | ||||
| } | } | ||||
| BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_out, "geom_split.out", BM_ALL_NOLOOP, ELE_SPLIT); | BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_out, "geom_split.out", BM_ALL_NOLOOP, ELE_SPLIT); | ||||
| BM_data_layer_free_n(bm, &bm->vdata, CD_SHAPEKEY, params.shape_info.tmpkey); | BM_data_layer_free_n(bm, &bm->vdata, CD_SHAPEKEY, params.shape_info.tmpkey); | ||||
| } | } | ||||