Commit: 19bb30baf6057d39a45f1e8693c6abcaceca84db Author: Germano Cavalcante Date: Wed Nov 23 23:14:56 2022 -0300 Branches: master https://developer.blender.org/rB19bb30baf6057d39a45f1e8693c6abcaceca84db
Fix T102735: Knife tool does not work properly in perspective viewport Use `ED_view3d_win_to_3d` to unproject the first click coords. This is the same function used in other tools like Draw Curve. Differential revision: https://developer.blender.org/D16617 =================================================================== 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 369162e80a3..dbe77805dd8 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -1897,17 +1897,9 @@ static void knife_start_cut(KnifeTool_OpData *kcd) kcd->mdata.is_stored = false; if (kcd->prev.vert == NULL && kcd->prev.edge == NULL) { - float origin[3], origin_ofs[3]; float ofs_local[3]; - negate_v3_v3(ofs_local, kcd->vc.rv3d->ofs); - - knife_input_ray_segment(kcd, kcd->curr.mval, 1.0f, origin, origin_ofs); - - if (!isect_line_plane_v3( - kcd->prev.cage, origin, origin_ofs, ofs_local, kcd->vc.rv3d->viewinv[2])) { - zero_v3(kcd->prev.cage); - } + ED_view3d_win_to_3d(kcd->vc.v3d, kcd->region, ofs_local, kcd->curr.mval, kcd->prev.cage); copy_v3_v3(kcd->prev.co, kcd->prev.cage); /* TODO: do we need this? */ copy_v3_v3(kcd->curr.cage, kcd->prev.cage); _______________________________________________ Bf-blender-cvs mailing list [email protected] List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
