Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Fri, 28 Apr 2017 17:39:24 +0000 (03:39 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 28 Apr 2017 17:39:24 +0000 (03:39 +1000)
1  2 
source/blender/editors/space_view3d/view3d_edit.c

index 028d613ba8c0ebafc95459c71c5604584414dfc4,f712c7906636683126eacdc0fd17cfb403154f62..42e8759c6dcb386a65ff8ef7139e320a0c16d74a
@@@ -705,6 -735,33 +733,34 @@@ static void viewops_data_create_ex
        ViewOpsData *vod = op->customdata;
        RegionView3D *rv3d = vod->rv3d;
  
 -                      vod->scene, vod->ar, vod->v3d,
+       /* we need the depth info before changing any viewport options */
+       if (orbit_mode == VIEWOPS_ORBIT_DEPTH) {
++              struct Depsgraph *graph = CTX_data_depsgraph(C);
+               float fallback_depth_pt[3];
+               view3d_operator_needs_opengl(C); /* needed for zbuf drawing */
+               negate_v3_v3(fallback_depth_pt, rv3d->ofs);
+               vod->use_dyn_ofs = ED_view3d_autodist(
++                      graph, vod->scene, vod->ar, vod->v3d,
+                       event->mval, vod->dyn_ofs, true, fallback_depth_pt);
+       }
+       else {
+               vod->use_dyn_ofs = false;
+       }
+       if (switch_from_camera) {
+               /* switch from camera view when: */
+               if (view3d_ensure_persp(vod->v3d, vod->ar)) {
+                       /* If we're switching from camera view to the perspective one,
+                        * need to tag viewport update, so camera vuew and borders
+                        * are properly updated.
+                        */
+                       ED_region_tag_redraw(vod->ar);
+               }
+       }
        /* set the view from the camera, if view locking is enabled.
         * we may want to make this optional but for now its needed always */
        ED_view3d_camera_lock_init(vod->v3d, vod->rv3d);