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:
authorCampbell Barton <ideasman42@gmail.com>2014-11-16 00:15:11 +0300
committerCampbell Barton <ideasman42@gmail.com>2014-11-16 00:17:37 +0300
commitc6ab67bffc84838bfc2b155ebd810dab8b860888 (patch)
tree6c920a48c2d5524b3bb0fb763d31840bffd9eb8e /source/blender
parentf7371dca823a21bdf0fe13c939ebd9245e18d1d6 (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.c14
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);