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:
authorDalai Felinto <dfelinto@gmail.com>2013-10-29 06:42:51 +0400
committerDalai Felinto <dfelinto@gmail.com>2013-10-29 06:42:51 +0400
commita7b44c82e5b90e83a588fabb22fda5ac41891bdf (patch)
tree2fdc4134bdc21e47d05fe69176bc5c85a4c448cd /source/blender/modifiers/intern/MOD_triangulate.c
parent427844c28d2083ffcec93066ebee3fcf0fd01e42 (diff)
Triangulate Modifier: using different ngon and quad methods
Quads: Beauty, Fixed, Fixed Alternate, Shortest Diagonal Ngons: Beauty, Scanfill * Shortest Diagonal is the default method in the modifier (popular elsewhere), but beauty is the default in Ctrl+T). * Remove the need for output slot and beauty operator to be called after Clt+T Patch with collaborations and reviewed by Campbell Barton
Diffstat (limited to 'source/blender/modifiers/intern/MOD_triangulate.c')
-rw-r--r--source/blender/modifiers/intern/MOD_triangulate.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/modifiers/intern/MOD_triangulate.c b/source/blender/modifiers/intern/MOD_triangulate.c
index ffc813068b8..d519c981a23 100644
--- a/source/blender/modifiers/intern/MOD_triangulate.c
+++ b/source/blender/modifiers/intern/MOD_triangulate.c
@@ -36,7 +36,7 @@
#include "bmesh.h"
#include "bmesh_tools.h"
-static DerivedMesh *triangulate_dm(DerivedMesh *dm, const int flag)
+static DerivedMesh *triangulate_dm(DerivedMesh *dm, const int quad_method, const int ngon_method)
{
DerivedMesh *result;
BMesh *bm;
@@ -45,7 +45,7 @@ static DerivedMesh *triangulate_dm(DerivedMesh *dm, const int flag)
bm = DM_to_bmesh(dm, true);
- BM_mesh_triangulate(bm, (flag & MOD_TRIANGULATE_BEAUTY), false, NULL, NULL);
+ BM_mesh_triangulate(bm, quad_method, ngon_method, false, NULL, NULL);
result = CDDM_from_bmesh(bm, FALSE);
BM_mesh_free(bm);
@@ -69,7 +69,8 @@ static void initData(ModifierData *md)
/* Enable in editmode by default */
md->mode |= eModifierMode_Editmode;
- tmd->flag = MOD_TRIANGULATE_BEAUTY;
+ tmd->quad_method = MOD_TRIANGULATE_QUAD_SHORTEDGE;
+ tmd->ngon_method = MOD_TRIANGULATE_NGON_BEAUTY;
}
@@ -88,7 +89,7 @@ static DerivedMesh *applyModifier(ModifierData *md,
{
TriangulateModifierData *tmd = (TriangulateModifierData *)md;
DerivedMesh *result;
- if (!(result = triangulate_dm(dm, tmd->flag))) {
+ if (!(result = triangulate_dm(dm, tmd->quad_method, tmd->ngon_method))) {
return dm;
}