py/bmesh api - add support for single item buffers (odd feature but used quite a...
[blender.git] / source / blender / bmesh / operators / bmo_slide.c
index 9dde2461364fe85b2d5139a56c61a583e5bd27e3..040c2d41e9c37610294ec4027b9b7477043f6a7c 100644 (file)
@@ -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 */