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
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/blender/bmesh/operators/mesh_conv.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/source/blender/bmesh/operators/mesh_conv.c b/source/blender/bmesh/operators/mesh_conv.c
index ca15079b65c..4f1e65a208e 100644
--- a/source/blender/bmesh/operators/mesh_conv.c
+++ b/source/blender/bmesh/operators/mesh_conv.c
@@ -413,6 +413,21 @@ static BMVert **bmesh_to_mesh_vertex_map(BMesh *bm, int ototvert)
return vertMap;
}
+BM_INLINE void bmesh_quick_edgedraw_flag(MEdge *med, BMEdge *e)
+{
+ /* this is a cheap way to set the edge draw, its not precise and will
+ * pick the first 2 faces an edge uses */
+
+
+ if ( /* (med->flag & ME_EDGEDRAW) && */ /* assume to be true */
+ (e->l && (e->l != e->l->radial_next)) &&
+ (dot_v3v3(e->l->f->no, e->l->radial_next->f->no) > 0.995f))
+ {
+ med->flag &= ~ME_EDGEDRAW;
+ }
+}
+
+
void bmesh_to_mesh_exec(BMesh *bm, BMOperator *op)
{
Mesh *me = BMO_Get_Pnt(op, "mesh");
@@ -532,6 +547,8 @@ void bmesh_to_mesh_exec(BMesh *bm, BMOperator *op)
/*copy over customdata*/
CustomData_from_bmesh_block(&bm->edata, &me->edata, e->head.data, i);
+ bmesh_quick_edgedraw_flag(med, e);
+
i++;
med++;
BM_CHECK_ELEMENT(bm, e);
@@ -661,21 +678,6 @@ void bmesh_to_mesh_exec(BMesh *bm, BMOperator *op)
mloop->e = BM_GetIndex(l->e);
mloop->v = BM_GetIndex(l->v);
-
-#if 1
- /* this is a cheap way to set the edge draw, just so happens
- * at this part of the code the info is available, feel free to
- * move this block of code elsewhere */
-
- if ( (l != l->radial_next) &&
- (medge[mloop->e].flag & ME_EDGEDRAW) &&
- (dot_v3v3(f->no, l->radial_next->f->no) > 0.995f))
- {
- medge[mloop->e].flag &= ~ME_EDGEDRAW;
- }
-#endif
-
-
/*copy over customdata*/
CustomData_from_bmesh_block(&bm->ldata, &me->ldata, l->head.data, j);
BM_CHECK_ELEMENT(bm, l);