Fix T62125: snapping not working if invisible object is between you and the target

If we were not in x-ray/wireframe mode, the snapping would treat all
objects like they were in solid mode. This were not desirable if you
had objects that were in wire or bounding box display mode.

Now objects that are in bounding box mode is ignored (unless the object
is in edit mode) and objects with wire display mode is treated as if
they were in x-ray mode.

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D4493
sculpt-mode-features
Sebastian Parborg 4 years ago
parent 81958a1393
commit 81a7f6c848

@ -685,6 +685,11 @@ static bool raycastObj(
switch (ob->type) {
case OB_MESH:
{
if (ob->dt == OB_BOUNDBOX || ob->dt == OB_WIRE) {
/* Do not hit objects that are in wire or bounding box display mode */
return false;
}
Mesh *me = ob->data;
if (BKE_object_is_in_editmode(ob)) {
BMEditMesh *em = BKE_editmesh_from_object(ob);
@ -2183,6 +2188,11 @@ static short snapObject(
me = em->mesh_eval_final;
}
}
else if (ob->dt == OB_BOUNDBOX) {
/* Do not snap to objects that are in bounding box display mode */
return 0;
}
retval = snapMesh(
sctx, snapdata, ob, me, obmat,
dist_px,

Loading…
Cancel
Save