diff options
author | Cian Jinks <cjinks99@gmail.com> | 2021-09-05 15:09:22 +0300 |
---|---|---|
committer | Cian Jinks <cjinks99@gmail.com> | 2021-09-05 15:09:22 +0300 |
commit | 4b8ab16797ce255ed3618ba1ef64f9d05ca46424 (patch) | |
tree | 5ca8377485858d3f89d8fbb1c5eabd1b03e9cf86 /source/blender/editors | |
parent | 4aa39919795ecd68589f9e0ec6be21a2fe4968dc (diff) |
Fix: Knife cut vertex sometimes placed in space
When using relative constrained angle mode along an edge which has a face hidden from view, if a cut is added it can sometimes place the previous cut vertex in space, away from the edge.
This was caused by knife_snap_edge_constrained not working correctly when a cut is constrained along the edge it was started from.
Fixed by adding a quick check.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/mesh/editmesh_knife.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 5bad09c6e9c..101a15ae636 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -3443,7 +3443,8 @@ static KnifeEdge *knife_find_closest_edge_of_face(KnifeTool_OpData *kcd, knife_project_v2(kcd, kfe->v2->cageco, kfv2_sco); /* Check if we're close enough and calculate 'lambda'. */ - if (kcd->is_angle_snapping || kcd->axis_constrained) { + /* In constrained mode calculate lambda differently, unless constrained along kcd->prev.edge */ + if ((kcd->is_angle_snapping || kcd->axis_constrained) && (kfe != kcd->prev.edge)) { dis_sq = curdis_sq; if (!knife_snap_edge_constrained(kcd, sco, kfv1_sco, kfv2_sco, &dis_sq, &lambda)) { continue; |