Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Wed, 5 Dec 2018 00:03:48 +0000 (11:03 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 5 Dec 2018 00:03:48 +0000 (11:03 +1100)
source/blender/editors/space_view3d/view3d_fly.c
source/blender/editors/space_view3d/view3d_walk.c

index 345d9fe39dea86f1522eca1066bb1c003483731e..de5d5d29e52ba110457d1a1055039f770871416e 100644 (file)
@@ -195,7 +195,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->depsgraph, fly->ar, fly->v3d, fly->rv3d, &viewborder, false);
                xoff = viewborder.xmin;
                yoff = viewborder.ymin;
@@ -297,7 +297,6 @@ enum {
 static bool initFlyInfo(bContext *C, FlyInfo *fly, wmOperator *op, const wmEvent *event)
 {
        wmWindow *win = CTX_wm_window(C);
-
        rctf viewborder;
 
        float upvec[3]; /* tmp */
@@ -377,7 +376,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->depsgraph, fly->ar, fly->v3d, fly->rv3d, &viewborder, false);
 
                fly->width = BLI_rctf_size_x(&viewborder);
index 68a40f3336872476564b933a37596ede6d522367..d4bb213e5c72a8b1b0abcc7f22994ee4ad1fba1f 100644 (file)
@@ -280,7 +280,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, walk->depsgraph, 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;