Fix for using non camera objects as a camera having zero area view-frame
[blender.git] / source / blender / editors / space_view3d / view3d_draw.c
index 4220bcf161bce67197e8349ec9416f9b916fe166..18f3d150eb29a3dc08abab6addeaad1764087bf8 100644 (file)
@@ -950,6 +950,9 @@ static void view3d_camera_border(Scene *scene, ARegion *ar, View3D *v3d, RegionV
 
        /* get camera viewplane */
        BKE_camera_params_init(&params);
+       /* fallback for non camera objects */
+       params.clipsta = v3d->near;
+       params.clipend = v3d->far;
        BKE_camera_params_from_object(&params, v3d->camera);
        if (no_shift) {
                params.shiftx = 0.0f;
@@ -2746,6 +2749,9 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, in
                CameraParams params;
 
                BKE_camera_params_init(&params);
+               /* fallback for non camera objects */
+               params.clipsta = v3d->near;
+               params.clipend = v3d->far;
                BKE_camera_params_from_object(&params, v3d->camera);
                BKE_camera_params_compute_viewplane(&params, sizex, sizey, scene->r.xasp, scene->r.yasp);
                BKE_camera_params_compute_matrix(&params);