[Bf-blender-cvs] [256c1b82f6e] blender-v3.0-release: Fix T93388: dropping object on grid in orthogonal view misses the floor plane

Germano Cavalcante noreply at git.blender.org
Mon Jan 10 17:04:40 CET 2022


Commit: 256c1b82f6e3e815ba4918f7c7bd91bcee11016a
Author: Germano Cavalcante
Date:   Sun Dec 5 23:29:23 2021 -0300
Branches: blender-v3.0-release
https://developer.blender.org/rB256c1b82f6e3e815ba4918f7c7bd91bcee11016a

Fix T93388: dropping object on grid in orthogonal view misses the floor plane

`ED_view3d_win_to_3d_on_plane` does not use the `clip_start` and
`clip_end` values of the scene, so the `do_clip` option can be misleading
especially in the orthographic view where the `clip_start` is negative.

For now, don't use the `do_clip` option in orthographic view.

===================================================================

M	source/blender/editors/space_view3d/view3d_cursor_snap.c

===================================================================

diff --git a/source/blender/editors/space_view3d/view3d_cursor_snap.c b/source/blender/editors/space_view3d/view3d_cursor_snap.c
index 1213614704d..f2b4d30aac5 100644
--- a/source/blender/editors/space_view3d/view3d_cursor_snap.c
+++ b/source/blender/editors/space_view3d/view3d_cursor_snap.c
@@ -716,6 +716,7 @@ static void v3d_cursor_snap_update(V3DSnapCursorState *state,
   float *co_depth = snap_elem ? co : scene->cursor.location;
   snap_elem &= ~data_intern->snap_elem_hidden;
   if (snap_elem == 0) {
+    RegionView3D *rv3d = region->regiondata;
     float plane[4];
     if (state->plane_depth != V3D_PLACE_DEPTH_CURSOR_VIEW) {
       const float *plane_normal = omat[state->plane_axis];
@@ -723,7 +724,7 @@ static void v3d_cursor_snap_update(V3DSnapCursorState *state,
     }
 
     if ((state->plane_depth == V3D_PLACE_DEPTH_CURSOR_VIEW) ||
-        !ED_view3d_win_to_3d_on_plane(region, plane, mval_fl, true, co)) {
+        !ED_view3d_win_to_3d_on_plane(region, plane, mval_fl, rv3d->is_persp, co)) {
       ED_view3d_win_to_3d(v3d, region, co_depth, mval_fl, co);
     }



More information about the Bf-blender-cvs mailing list