[Bf-blender-cvs] [c6ab67b] master: Fix T42611: Knife fails from an edge to a vertex

Campbell Barton noreply at git.blender.org
Sat Nov 15 22:22:50 CET 2014


Commit: c6ab67bffc84838bfc2b155ebd810dab8b860888
Author: Campbell Barton
Date:   Sat Nov 15 22:15:11 2014 +0100
Branches: master
https://developer.blender.org/rBc6ab67bffc84838bfc2b155ebd810dab8b860888

Fix T42611: Knife fails from an edge to a vertex

===================================================================

M	source/blender/editors/mesh/editmesh_knife.c

===================================================================

diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index 2f8a58b..6681526 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);




More information about the Bf-blender-cvs mailing list