From d358458a8d3bc37c4ea5418fa6e6c9c259704f51 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 27 Mar 2013 07:54:11 +0000 Subject: fix for mesh face filling when a valid edge-loop was selected but unselected connecting geometry existed inside the loop. In this case edgenet_fill operator failed and it would fallback to filling as unordered vertices which was mostly fine but failed on some concave loops. Add a new bmesh operator 'edgeloop_fill' fills in closed loops even if they don't make a valid edge-net. --- source/blender/bmesh/intern/bmesh_opdefines.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (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 869c894b66c..7583332c4db 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -526,6 +526,30 @@ static BMOpDefine bmo_bridge_loops_def = { 0, }; +/* + * Edge Loop Fill. + * + * Create faces defined by one or more non overlapping edge loops. + */ +static BMOpDefine bmo_edgeloop_fill_def = { + "edgeloop_fill", + /* slots_in */ + {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */ + /* restricts edges to groups. maps edges to integer */ + {"mat_nr", BMO_OP_SLOT_INT}, /* material to use */ + {"use_smooth", BMO_OP_SLOT_BOOL}, /* smooth state to use */ + {{'\0'}}, + }, + /* slots_out */ + /* maps new faces to the group numbers they came from */ + {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* new faces */ + {{'\0'}}, + }, + bmo_edgeloop_fill_exec, + 0, +}; + + /* * Edge Net Fill. * @@ -541,7 +565,7 @@ static BMOpDefine bmo_edgenet_fill_def = { {"use_fill_check", BMO_OP_SLOT_BOOL}, {"exclude_faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* list of faces to ignore for manifold check */ {"mat_nr", BMO_OP_SLOT_INT}, /* material to use */ - {"use_smooth", BMO_OP_SLOT_BOOL}, /* material to use */ + {"use_smooth", BMO_OP_SLOT_BOOL}, /* smooth state to use */ {{'\0'}}, }, /* slots_out */ @@ -1615,6 +1639,7 @@ const BMOpDefine *bmo_opdefines[] = { &bmo_dissolve_limit_def, &bmo_dissolve_verts_def, &bmo_duplicate_def, + &bmo_edgeloop_fill_def, &bmo_edgenet_fill_def, &bmo_edgenet_prepare_def, &bmo_extrude_discrete_faces_def, -- cgit v1.2.3