Fix T42611: Knife fails from an edge to a vertex

This commit is contained in:
Campbell Barton 2014-11-15 22:15:11 +01:00
parent f7371dca82
commit c6ab67bffc
Notes: blender-bot 2023-02-14 10:04:50 +01:00
Referenced by issue #42701, Refraction BSDF Renders Slower With Extreme Edges?
Referenced by issue #42688, python crash: bpy.context.scene.update()
Referenced by issue #42619, python crash: bpy.context.screen.is_animation_playing
Referenced by issue #42611, Knife tool fails to cut from an edge to a vertex
1 changed files with 14 additions and 0 deletions

View File

@ -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);