Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <mail@jlucke.com>2019-05-27 15:15:07 +0300
committerJacques Lucke <mail@jlucke.com>2019-05-27 15:16:40 +0300
commitf3fb7c5f22cf33e6cfe1392387e187ecb5cb7699 (patch)
treefa2bc587ed439886f147492e381b97281a85730a /source/blender/draw
parent4ad9d93fec776afdd27257a425d33d65d67f240b (diff)
Fix T65177: Camera frame visible in viewport render
Diffstat (limited to 'source/blender/draw')
-rw-r--r--source/blender/draw/modes/object_mode.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c
index 5a9dc29ce6b..7e3a6eef9f2 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -2134,29 +2134,31 @@ static void DRW_shgroup_camera(OBJECT_ShadingGroupList *sgl, Object *ob, ViewLay
cam->runtime.drw_tria[1][1] = shift[1] + ((1.1f * drawsize * (asp[1] + 0.7f)) * scale[1]);
if (look_through) {
- /* Only draw the frame. */
- float mat[4][4];
- if (is_multiview) {
- 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);
- const float shiftx = BKE_camera_multiview_shift_x(&scene->r, ob, view_name);
- const float delta_shiftx = shiftx - cam->shiftx;
- const float width = cam->runtime.drw_corners[0][2][0] - cam->runtime.drw_corners[0][0][0];
- for (int i = 0; i < 4; i++) {
- cam->runtime.drw_corners[0][i][0] -= delta_shiftx * width;
+ if (!DRW_state_is_image_render()) {
+ /* Only draw the frame. */
+ float mat[4][4];
+ if (is_multiview) {
+ 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);
+ const float shiftx = BKE_camera_multiview_shift_x(&scene->r, ob, view_name);
+ const float delta_shiftx = shiftx - cam->shiftx;
+ const float width = cam->runtime.drw_corners[0][2][0] - cam->runtime.drw_corners[0][0][0];
+ for (int i = 0; i < 4; i++) {
+ cam->runtime.drw_corners[0][i][0] -= delta_shiftx * width;
+ }
+ }
+ else {
+ copy_m4_m4(mat, ob->obmat);
}
- }
- else {
- copy_m4_m4(mat, ob->obmat);
- }
- DRW_buffer_add_entry(sgl->camera_frame,
- color,
- cam->runtime.drw_corners[0],
- &cam->runtime.drw_depth[0],
- cam->runtime.drw_tria,
- mat);
+ DRW_buffer_add_entry(sgl->camera_frame,
+ color,
+ cam->runtime.drw_corners[0],
+ &cam->runtime.drw_depth[0],
+ cam->runtime.drw_tria,
+ mat);
+ }
}
else {
if (!is_stereo3d_cameras) {