diff options
author | mano-wii <germano.costa@ig.com.br> | 2019-04-08 16:49:15 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2019-04-08 16:49:15 +0300 |
commit | d6f02cd1d75a9f7bb4fd9a5bf945779324c86896 (patch) | |
tree | 6f96d7e6b788c6805529f2862156afbd37a67198 | |
parent | b8a442b202436da3b2e76791be762f5b284bcc53 (diff) |
Fix T63340: Transform Snap Object: Simulate occlusion only when `use_occlusion_test` is true.
And cleanup.
-rw-r--r-- | source/blender/editors/transform/transform_snap_object.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c index ea3657b8729..7ca62b89bf9 100644 --- a/source/blender/editors/transform/transform_snap_object.c +++ b/source/blender/editors/transform/transform_snap_object.c @@ -673,21 +673,22 @@ static bool raycastObj( { bool retval = false; - if (use_occlusion_test) { - if (use_obedit && sctx->use_v3d && - !V3D_IS_ZBUF(sctx->v3d_data.v3d)) - { - /* Use of occlude geometry in editing mode disabled. */ - return false; - } - } - 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; + if (use_occlusion_test) { + if (use_obedit && sctx->use_v3d && + !V3D_IS_ZBUF(sctx->v3d_data.v3d)) + { + /* Use of occlude geometry in editing mode disabled. */ + return false; + } + + if (ELEM(ob->dt, OB_BOUNDBOX, OB_WIRE)) { + /* Do not hit objects that are in wire or bounding box + * display mode. */ + return false; + } } Mesh *me = ob->data; @@ -2540,8 +2541,7 @@ static short transform_snap_context_project_view3d_mixed_impl( const RegionView3D *rv3d = ar->regiondata; bool use_occlusion_test = - params->use_occlusion_test && - !(sctx->v3d_data.v3d->shading.flag & V3D_XRAY_FLAG(sctx->v3d_data.v3d)); + params->use_occlusion_test && V3D_IS_ZBUF(sctx->v3d_data.v3d); if (snap_to_flag & SCE_SNAP_MODE_FACE || use_occlusion_test) { float ray_start[3], ray_normal[3]; |