diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-18 19:14:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-18 19:14:55 +0400 |
commit | c5e14f62a673507a6298bf9f676f6de11d193f07 (patch) | |
tree | 566e8f7fe07f0713f1667b236998cbb9dd94f492 /source/blender/bmesh/intern | |
parent | a71f84606a383801d4e6ceb8106bcc33857a5322 (diff) |
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.
Diffstat (limited to 'source/blender/bmesh/intern')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_opdefines.c | 28 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_operators_private.h | 1 |
2 files changed, 27 insertions, 2 deletions
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 @@ -577,6 +577,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. * * Create faces defined by one or more non overlapping edge loops. @@ -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, diff --git a/source/blender/bmesh/intern/bmesh_operators_private.h b/source/blender/bmesh/intern/bmesh_operators_private.h index 33c10411c0f..35fd9b3d530 100644 --- a/source/blender/bmesh/intern/bmesh_operators_private.h +++ b/source/blender/bmesh/intern/bmesh_operators_private.h @@ -59,6 +59,7 @@ void bmo_dissolve_limit_exec(BMesh *bm, BMOperator *op); void bmo_dissolve_verts_exec(BMesh *bm, BMOperator *op); void bmo_duplicate_exec(BMesh *bm, BMOperator *op); void bmo_edgeloop_fill_exec(BMesh *bm, BMOperator *op); +void bmo_face_attribute_fill_exec(BMesh *bm, BMOperator *op); void bmo_holes_fill_exec(BMesh *bm, BMOperator *op); void bmo_edgenet_fill_exec(BMesh *bm, BMOperator *op); void bmo_edgenet_prepare_exec(BMesh *bm, BMOperator *op); |