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:
authorAntony Riakiotakis <kalast@gmail.com>2012-11-20 13:04:55 +0400
committerAntony Riakiotakis <kalast@gmail.com>2012-11-20 13:04:55 +0400
commitc7003a7dc80b6b89d5b78f1cde37f16ffa237e44 (patch)
treec85b9c65498086f773e5dd9967297d647cab1fc1 /source/blender/modifiers/intern/MOD_triangulate.c
parent6ea7bf2278e9aea329009ce9b7a0df91fe10cfc1 (diff)
Skip CDDM_calc_edges since it's a costly operation. Instead make sure
all edges are set to draw. Thanks to Campbel for pointing that out!
Diffstat (limited to 'source/blender/modifiers/intern/MOD_triangulate.c')
-rw-r--r--source/blender/modifiers/intern/MOD_triangulate.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/modifiers/intern/MOD_triangulate.c b/source/blender/modifiers/intern/MOD_triangulate.c
index 1e5b10e3d62..645fd5eb2cf 100644
--- a/source/blender/modifiers/intern/MOD_triangulate.c
+++ b/source/blender/modifiers/intern/MOD_triangulate.c
@@ -39,6 +39,8 @@ static DerivedMesh *triangulate_dm(DerivedMesh *dm, const int flag)
{
DerivedMesh *result;
BMesh *bm;
+ int total_edges, i;
+ MEdge *me;
bm = DM_to_bmesh(dm);
@@ -53,7 +55,12 @@ static DerivedMesh *triangulate_dm(DerivedMesh *dm, const int flag)
result = CDDM_from_bmesh(bm, FALSE);
BM_mesh_free(bm);
- CDDM_calc_edges(result);
+ total_edges = result->getNumEdges(result);
+ me = CDDM_get_edges(result);
+
+ /* force drawing of all edges (seems to be omitted in CDDM_from_bmesh) */
+ for (i = 0; i < total_edges; i++, me++)
+ me->flag |= ME_EDGEDRAW | ME_EDGERENDER;
CDDM_calc_normals(result);