Fix #116262: Modal knife tool can crash if used on hidden object #119383
|
@ -3213,7 +3213,9 @@ static BMFace *knife_find_closest_face(KnifeTool_OpData *kcd,
|
|||
vc.mval[0] = int(kcd->curr.mval[0]);
|
||||
vc.mval[1] = int(kcd->curr.mval[1]);
|
||||
|
||||
f = EDBM_face_find_nearest(&vc, &dist);
|
||||
if (BKE_object_is_visible_in_viewport(vc.v3d, vc.obact)) {
|
||||
|
||||
f = EDBM_face_find_nearest(&vc, &dist);
|
||||
}
|
||||
|
||||
/* Cheat for now; just put in the origin instead
|
||||
* of a true coordinate on the face.
|
||||
|
|
Loading…
Reference in New Issue
It looks like the
ViewContext
and comment can be moved inside this block.Ideally all objects in
kcd->objects
should be tested for "nearest".And for further improvements, the back-buffer could not even be used if we used the BVH nearest function instead.
But these changes are more involved. For bug fixing, it looks fine.
Yep, yep and yep.
Will do separately.