Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-08-23 14:12:09 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-08-23 14:12:09 +0400
commit5b5cae86b72776375f1b01dc555d98429e5c5782 (patch)
tree506f3253ce96cd4174199bb33a662e74fe01899a /source/blender/bmesh/operators/bmo_triangulate.c
parent2e2ea1ae212c8a660eb468119a7fb1bce17a46b9 (diff)
optiona for bmesh triangle fill operator to take a normal argument
Diffstat (limited to 'source/blender/bmesh/operators/bmo_triangulate.c')
-rw-r--r--source/blender/bmesh/operators/bmo_triangulate.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/bmesh/operators/bmo_triangulate.c b/source/blender/bmesh/operators/bmo_triangulate.c
index 2d6fad7afc9..46a8295dfd4 100644
--- a/source/blender/bmesh/operators/bmo_triangulate.c
+++ b/source/blender/bmesh/operators/bmo_triangulate.c
@@ -66,8 +66,11 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op)
ScanFillVert *sf_vert, *sf_vert_1, *sf_vert_2;
ScanFillFace *sf_tri;
SmallHash hash;
+ float normal[3], *normal_pt;
BLI_smallhash_init(&hash);
+
+ BMO_slot_vec_get(op->slots_in, "normal", normal);
BLI_scanfill_begin(&sf_ctx);
@@ -92,7 +95,15 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op)
/* sf_edge->tmp.p = e; */ /* UNUSED */
}
- BLI_scanfill_calc(&sf_ctx, BLI_SCANFILL_CALC_HOLES);
+ if (is_zero_v3(normal)) {
+ normal_pt = NULL;
+ }
+ else {
+ normalize_v3(normal);
+ normal_pt = normal;
+ }
+
+ BLI_scanfill_calc_ex(&sf_ctx, BLI_SCANFILL_CALC_HOLES, normal_pt);
for (sf_tri = sf_ctx.fillfacebase.first; sf_tri; sf_tri = sf_tri->next) {
BMFace *f = BM_face_create_quad_tri(bm,