Fix T62118: Stereo drawing options visible from camera view
authorDalai Felinto <dfelinto@gmail.com>
Wed, 6 Mar 2019 12:08:38 +0000 (09:08 -0300)
committerDalai Felinto <dfelinto@gmail.com>
Wed, 6 Mar 2019 13:59:32 +0000 (10:59 -0300)
Note 1: Volume drawing still draws differently than 2.7x.
Note 2: Camera lens widget still ignores stereo.

source/blender/draw/modes/object_mode.c

index b837ffef0db73b7be2d86634d9d0f49cfb0343d6..0fa4d328ebdf998fd4e15c8ba2521405c5a01894 100644 (file)
@@ -1867,10 +1867,10 @@ static void DRW_shgroup_camera(OBJECT_ShadingGroupList *sgl, Object *ob, ViewLay
        cam->runtime.drw_tria[1][0] = shift[0];
        cam->runtime.drw_tria[1][1] = shift[1] + ((1.1f * drawsize * (asp[1] + 0.7f)) * scale[1]);
 
-       if (look_through && !is_stereo3d_cameras) {
+       if (look_through) {
                /* Only draw the frame. */
                float mat[4][4];
-               if (is_stereo3d) {
+               if (is_stereo3d_view) {
                        const bool is_left = v3d->multiview_eye == STEREO_LEFT_ID;
                        const char *view_name = is_left ? STEREO_LEFT_NAME : STEREO_RIGHT_NAME;
                        BKE_camera_multiview_model_matrix(&scene->r, ob, view_name, mat);
@@ -1888,7 +1888,7 @@ static void DRW_shgroup_camera(OBJECT_ShadingGroupList *sgl, Object *ob, ViewLay
                        sgl->camera_frame, color, cam->runtime.drw_corners[0],
                        &cam->runtime.drw_depth[0], cam->runtime.drw_tria, mat);
        }
-       else if (!look_through) {
+       else {
                if (!is_stereo3d_cameras) {
                        DRW_shgroup_call_dynamic_add(
                                sgl->camera, color, cam->runtime.drw_corners[0],
@@ -1944,7 +1944,7 @@ static void DRW_shgroup_camera(OBJECT_ShadingGroupList *sgl, Object *ob, ViewLay
        }
 
        /* Stereo cameras drawing. */
-       if (is_stereo3d) {
+       if (is_stereo3d && !look_through) {
                camera_stereo3d(sgl, scene, view_layer, v3d, ob, cam, vec, drawsize, scale);
        }