From c5e14f62a673507a6298bf9f676f6de11d193f07 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 18 Aug 2013 15:14:55 +0000 Subject: bmesh improvements to face creation. * fill-holes operator now takes advantage of new edge-net fill, works in many more cases then it did before. * face-create that uses edge-net now initializes the normals based on surrounding geometry, only running normal calculation if there are no connected faces for a reference. --- source/blender/bmesh/intern/bmesh_opdefines.c | 28 +++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (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 371d55f385e..615654c1c3a 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -576,6 +576,28 @@ static BMOpDefine bmo_holes_fill_def = { }; +/* + * Face Attribute Fill. + * + * Fill in faces with data from adjacent faces. + */ +static BMOpDefine bmo_face_attribute_fill_def = { + "face_attribute_fill", + /* slots_in */ + {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */ + {"use_normals", BMO_OP_SLOT_BOOL}, /* copy face winding */ + {"use_data", BMO_OP_SLOT_BOOL}, /* copy face data */ + {{'\0'}}, + }, + /* slots_out */ + /* maps new faces to the group numbers they came from */ + {{"faces_fail.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* faces that could not be handled */ + {{'\0'}}, + }, + bmo_face_attribute_fill_exec, + BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, +}; + /* * Edge Loop Fill. * @@ -609,8 +631,9 @@ static BMOpDefine bmo_edgenet_fill_def = { "edgenet_fill", /* slots_in */ {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */ - {"mat_nr", BMO_OP_SLOT_INT}, /* material to use */ - {"use_smooth", BMO_OP_SLOT_BOOL}, /* smooth state to use */ + {"mat_nr", BMO_OP_SLOT_INT}, /* material to use */ + {"use_smooth", BMO_OP_SLOT_BOOL}, /* smooth state to use */ + {"sides", BMO_OP_SLOT_INT}, /* number of sides */ {{'\0'}}, }, /* slots_out */ @@ -1770,6 +1793,7 @@ const BMOpDefine *bmo_opdefines[] = { &bmo_dissolve_verts_def, &bmo_duplicate_def, &bmo_holes_fill_def, + &bmo_face_attribute_fill_def, &bmo_edgeloop_fill_def, &bmo_edgenet_fill_def, &bmo_edgenet_prepare_def, -- cgit v1.2.3