diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-11-16 00:15:11 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-11-16 00:17:37 +0300 |
commit | c6ab67bffc84838bfc2b155ebd810dab8b860888 (patch) | |
tree | 6c920a48c2d5524b3bb0fb763d31840bffd9eb8e /source/blender | |
parent | f7371dca823a21bdf0fe13c939ebd9245e18d1d6 (diff) |
Fix T42611: Knife fails from an edge to a vertex
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/mesh/editmesh_knife.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 2f8a58b42a2..6681526f1b8 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -1437,6 +1437,20 @@ static void knife_find_line_hits(KnifeTool_OpData *kcd) if (point_is_visible(kcd, v->cageco, s, &mats)) { memset(&hit, 0, sizeof(hit)); hit.v = v; + + /* If this isn't from an existing BMVert, it may have been added to a BMEdge originally. + * knowing if the hit comes from an edge is important for edge-in-face checks later on + * see: #knife_add_single_cut -> #knife_verts_edge_in_face, T42611 */ + if (v->v == NULL) { + for (ref = v->edges.first; ref; ref = ref->next) { + kfe = ref->ref; + if (kfe->e) { + hit.kfe = kfe; + break; + } + } + } + copy_v3_v3(hit.hit, v->co); copy_v3_v3(hit.cagehit, v->cageco); copy_v2_v2(hit.schit, s); |