diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-11-27 13:21:57 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-11-27 13:21:57 +0400 |
commit | a9855c227e6bfc955a6b2f15e8ee656218c3f916 (patch) | |
tree | 8e49eb73516a927b9cfb1516d764d14c857a9af1 /source/blender/bmesh/operators/bmo_slide.c | |
parent | 0cd26e6066a071ecd230aa9b865b9223ea4ba13a (diff) |
py/bmesh api - add support for single item buffers (odd feature but used quite a bit with bmesh operators).
also add utility functions BMO_slot_buffer_from_single(), BMO_slot_buffer_get_single()
Diffstat (limited to 'source/blender/bmesh/operators/bmo_slide.c')
-rw-r--r-- | source/blender/bmesh/operators/bmo_slide.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/source/blender/bmesh/operators/bmo_slide.c b/source/blender/bmesh/operators/bmo_slide.c index 9dde2461364..040c2d41e9c 100644 --- a/source/blender/bmesh/operators/bmo_slide.c +++ b/source/blender/bmesh/operators/bmo_slide.c @@ -56,8 +56,7 @@ void bmo_slide_vert_exec(BMesh *bm, BMOperator *op) const float distance_t = BMO_slot_float_get(op->slots_in, "distance_t"); /* Get start vertex */ - vertex = BMO_iter_new(&oiter, op->slots_in, "vert", BM_VERT); - + vertex = BMO_slot_buffer_get_single(BMO_slot_get(op->slots_in, "vert")); if (!vertex) { if (G.debug & G_DEBUG) { @@ -67,15 +66,13 @@ void bmo_slide_vert_exec(BMesh *bm, BMOperator *op) return; } + /* BMESH_TODO - this is odd, it only uses one edge, why take a list at all? */ /* Count selected edges */ - BMO_ITER (h, &oiter, op->slots_in, "edge", BM_VERT | BM_EDGE) { - switch (h->htype) { - case BM_EDGE: - selected_edges++; - /* Mark all selected edges (cast BMHeader->BMEdge) */ - BMO_elem_flag_enable(bm, (BMElemF *)h, EDGE_MARK); - break; - } + BMO_ITER (h, &oiter, op->slots_in, "edges", BM_EDGE) { + selected_edges++; + /* Mark all selected edges (cast BMHeader->BMEdge) */ + BMO_elem_flag_enable(bm, (BMElemF *)h, EDGE_MARK); + break; } /* Only allow sliding if an edge is selected */ |