From 1d5f988778ef0e4779e708db9f1921e5713e373c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 6 Apr 2013 02:45:43 +0000 Subject: patch [#34890] BMesh Poke Face. by Francisco De La Cruz (xercesblue), with some of my own changes/improvements. Converts faces to triangle-fans (useful to run on ngons). To access select a group of faces and press "Alt+P" or alternatively select the operator from the Faces menu (Ctrl+F) --- source/blender/bmesh/intern/bmesh_opdefines.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'source/blender/bmesh/intern/bmesh_opdefines.c') diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c index c76bf15022c..83f57baea18 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -1571,6 +1571,28 @@ static BMOpDefine bmo_wireframe_def = { 0 }; +/* + * Pokes a face. + * + * Splits a face into a triangle fan. + */ +static BMOpDefine bmo_poke_def = { + "poke", + /* slots_in */ + {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */ + {"offset", BMO_OP_SLOT_FLT}, /* center vertex offset along normal */ + {"center_mode", BMO_OP_SLOT_INT}, /* calculation mode for center vertex */ + {{'\0'}}, + }, + /* slots_out */ + {{"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output verts */ + {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */ + {{'\0'}}, + }, + bmo_poke_exec, + 0 +}; + #ifdef WITH_BULLET /* * Convex Hull @@ -1677,6 +1699,7 @@ const BMOpDefine *bmo_opdefines[] = { &bmo_object_load_bmesh_def, &bmo_pointmerge_def, &bmo_pointmerge_facedata_def, + &bmo_poke_def, &bmo_recalc_face_normals_def, &bmo_region_extend_def, &bmo_remove_doubles_def, -- cgit v1.2.3