Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Thu, 20 Sep 2018 02:46:04 +0000 (12:46 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 20 Sep 2018 02:51:16 +0000 (12:51 +1000)
source/blender/editors/curve/editcurve_paint.c
source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c
source/blender/editors/include/ED_view3d.h
source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c
source/blender/editors/space_view3d/view3d_project.c

index b249af1c8b6c716b45c2df1a6e74b87340249326..ad128b91c5afa642dfe88278e1389d4ea6bef9f7 100644 (file)
@@ -202,12 +202,7 @@ static bool stroke_elem_project(
        /* project to 'location_world' */
        if (cdd->project.use_plane) {
                /* get the view vector to 'location' */
-               float ray_origin[3], ray_direction[3];
-               ED_view3d_win_to_ray(ar, mval_fl, ray_origin, ray_direction);
-
-               float lambda;
-               if (isect_ray_plane_v3(ray_origin, ray_direction, cdd->project.plane, &lambda, true)) {
-                       madd_v3_v3v3fl(r_location_world, ray_origin, ray_direction, lambda);
+               if (ED_view3d_win_to_3d_on_plane(ar, cdd->project.plane, mval_fl, true, r_location_world)) {
                        if (r_normal_world) {
                                zero_v3(r_normal_world);
                        }
index 6b1a76c47eefcb0599f06d2bfbd7574357c8f46d..a6252cd55bdd07ac1743fe5be2949efd37934ddb 100644 (file)
@@ -222,12 +222,12 @@ static void dial_ghostarc_get_angles(
 
        plane_from_point_normal_v3(dial_plane, gz->matrix_basis[3], axis_vec);
 
-       if (!ED_view3d_win_to_3d_on_plane(ar, dial_plane, inter->init.mval, proj_mval_init_rel)) {
+       if (!ED_view3d_win_to_3d_on_plane(ar, dial_plane, inter->init.mval, false, proj_mval_init_rel)) {
                goto fail;
        }
        sub_v3_v3(proj_mval_init_rel, gz->matrix_basis[3]);
 
-       if (!ED_view3d_win_to_3d_on_plane(ar, dial_plane, mval, proj_mval_new_rel)) {
+       if (!ED_view3d_win_to_3d_on_plane(ar, dial_plane, mval, false, proj_mval_new_rel)) {
                goto fail;
        }
        sub_v3_v3(proj_mval_new_rel, gz->matrix_basis[3]);
index 8e9c1736122062eb27bc62c9ca5e6b8e35993051..30daaad3c2cd34b82a3c2cb1cb7fa81ee96e2fab 100644 (file)
@@ -274,11 +274,11 @@ void ED_view3d_win_to_3d_int(
         float r_out[3]);
 bool ED_view3d_win_to_3d_on_plane(
         const struct ARegion *ar,
-        const float plane[4], const float mval[2],
+        const float plane[4], const float mval[2], const bool do_clip,
         float r_out[3]);
 bool ED_view3d_win_to_3d_on_plane_int(
         const struct ARegion *ar,
-        const float plane[4], const int mval[2],
+        const float plane[4], const int mval[2], const bool do_clip,
         float r_out[3]);
 void ED_view3d_win_to_delta(const struct ARegion *ar, const float mval[2], float out[3], const float zfac);
 void ED_view3d_win_to_origin(const struct ARegion *ar, const float mval[2], float out[3]);
index 038a45650bf6aed6db0bc725ea6c3f98e0103531..e8f29d9a9b26880feeacf04e57290356bc9f9541 100644 (file)
@@ -541,7 +541,7 @@ static void gizmo_mesh_spin_redo_modal_from_setup(
                const int mval[2] = {event->x - ar->winrct.xmin, event->y - ar->winrct.ymin};
                float plane[4];
                plane_from_point_normal_v3(plane, plane_co, plane_no);
-               if (UNLIKELY(!ED_view3d_win_to_3d_on_plane_int(ar, plane, mval, cursor_co))) {
+               if (UNLIKELY(!ED_view3d_win_to_3d_on_plane_int(ar, plane, mval, false, cursor_co))) {
                        ED_view3d_win_to_3d_int(v3d, ar, plane, mval, cursor_co);
                }
                sub_v3_v3v3(ggd->data.orient_axis, cursor_co, plane_co);
index 6e8b7c281cec1d762ac645267969adf6d1149cd6..116f4af34e57b3c3da493b570e2b00c41048f559 100644 (file)
@@ -559,14 +559,14 @@ void ED_view3d_win_to_3d_int(
 
 bool ED_view3d_win_to_3d_on_plane(
         const ARegion *ar,
-        const float plane[4], const float mval[2],
+        const float plane[4], const float mval[2], const bool do_clip,
         float r_out[3])
 {
        float ray_co[3], ray_no[3];
        ED_view3d_win_to_origin(ar, mval, ray_co);
        ED_view3d_win_to_vector(ar, mval, ray_no);
        float lambda;
-       if (isect_ray_plane_v3(ray_co, ray_no, plane, &lambda, false)) {
+       if (isect_ray_plane_v3(ray_co, ray_no, plane, &lambda, do_clip)) {
                madd_v3_v3v3fl(r_out, ray_co, ray_no, lambda);
                return true;
        }
@@ -575,11 +575,11 @@ bool ED_view3d_win_to_3d_on_plane(
 
 bool ED_view3d_win_to_3d_on_plane_int(
         const ARegion *ar,
-        const float plane[4], const int mval[2],
+        const float plane[4], const int mval[2], const bool do_clip,
         float r_out[3])
 {
        const float mval_fl[2] = {mval[0], mval[1]};
-       return ED_view3d_win_to_3d_on_plane(ar, plane, mval_fl, r_out);
+       return ED_view3d_win_to_3d_on_plane(ar, plane, mval_fl, do_clip, r_out);
 }
 
 /**