Fix T49624: Fly uses camera settings outside camera view
authorCampbell Barton <ideasman42@gmail.com>
Tue, 4 Dec 2018 21:36:37 +0000 (08:36 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 4 Dec 2018 21:36:37 +0000 (08:36 +1100)
source/blender/editors/space_view3d/view3d_fly.c
source/blender/editors/space_view3d/view3d_walk.c

index 320c00240c1275dd487a9827f61552bd1b3d03ed..175dab28cbe36a6113e0d3efb06ed29b784b949e 100644 (file)
@@ -240,7 +240,7 @@ static void drawFlyPixel(const struct bContext *UNUSED(C), ARegion *UNUSED(ar),
        int xoff, yoff;
        float x1, x2, y1, y2;
 
-       if (fly->scene->camera) {
+       if (ED_view3d_cameracontrol_object_get(fly->v3d_camera_control)) {
                ED_view3d_calc_camera_border(fly->scene, fly->ar, fly->v3d, fly->rv3d, &viewborder, false);
                xoff = viewborder.xmin;
                yoff = viewborder.ymin;
@@ -411,7 +411,7 @@ static bool initFlyInfo(bContext *C, FlyInfo *fly, wmOperator *op, const wmEvent
                (U.uiflag & USER_CAM_LOCK_NO_PARENT) == 0);
 
        /* calculate center */
-       if (fly->scene->camera) {
+       if (ED_view3d_cameracontrol_object_get(fly->v3d_camera_control)) {
                ED_view3d_calc_camera_border(fly->scene, fly->ar, fly->v3d, fly->rv3d, &viewborder, false);
 
                fly->width = BLI_rctf_size_x(&viewborder);
index 33173ad3fd663a08673eb91e1f9caa8066043898..b81d84a1436747a96fa8071258ccf9a4118477d0 100644 (file)
@@ -327,7 +327,7 @@ static void drawWalkPixel(const struct bContext *UNUSED(C), ARegion *ar, void *a
        int xoff, yoff;
        rctf viewborder;
 
-       if (walk->scene->camera) {
+       if (ED_view3d_cameracontrol_object_get(walk->v3d_camera_control)) {
                ED_view3d_calc_camera_border(walk->scene, ar, walk->v3d, walk->rv3d, &viewborder, false);
                xoff = viewborder.xmin + BLI_rctf_size_x(&viewborder) * 0.5f;
                yoff = viewborder.ymin + BLI_rctf_size_y(&viewborder) * 0.5f;