Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/modes/object_mode.c
| Show First 20 Lines • Show All 1,818 Lines • ▼ Show 20 Lines | static void DRW_shgroup_camera(OBJECT_ShadingGroupList *sgl, Object *ob, ViewLayer *view_layer) | ||||
| Camera *cam = ob->data; | Camera *cam = ob->data; | ||||
| const Object *camera_object = DEG_get_evaluated_object(draw_ctx->depsgraph, v3d->camera); | const Object *camera_object = DEG_get_evaluated_object(draw_ctx->depsgraph, v3d->camera); | ||||
| const bool is_select = DRW_state_is_select(); | const bool is_select = DRW_state_is_select(); | ||||
| const bool is_active = (ob == camera_object); | const bool is_active = (ob == camera_object); | ||||
| const bool look_through = (is_active && (rv3d->persp == RV3D_CAMOB)); | const bool look_through = (is_active && (rv3d->persp == RV3D_CAMOB)); | ||||
| const bool is_multiview = (scene->r.scemode & R_MULTIVIEW) != 0; | const bool is_multiview = (scene->r.scemode & R_MULTIVIEW) != 0; | ||||
| const bool is_stereo3d = is_active && camera_view3d_is_stereo3d(scene, v3d); | const bool is_stereo3d = is_active && camera_view3d_is_stereo3d(scene, v3d); | ||||
| const bool is_stereo3d_view = (scene->r.views_format == SCE_VIEWS_FORMAT_STEREO_3D); | const bool is_stereo3d_view = is_stereo3d && (scene->r.views_format == SCE_VIEWS_FORMAT_STEREO_3D); | ||||
| const bool is_stereo3d_cameras = (ob == scene->camera) && | const bool is_stereo3d_cameras = (ob == scene->camera) && | ||||
| is_multiview && | is_multiview && | ||||
| is_stereo3d_view && | is_stereo3d_view && | ||||
| (v3d->stereo3d_flag & V3D_S3D_DISPCAMERAS); | (v3d->stereo3d_flag & V3D_S3D_DISPCAMERAS); | ||||
| const bool is_selection_camera_stereo = is_select && | const bool is_selection_camera_stereo = is_select && | ||||
| look_through && is_multiview && | look_through && is_multiview && | ||||
| is_stereo3d_view; | is_stereo3d_view; | ||||
| Show All 34 Lines | static void DRW_shgroup_camera(OBJECT_ShadingGroupList *sgl, Object *ob, ViewLayer *view_layer) | ||||
| if (look_through) { | if (look_through) { | ||||
| /* Only draw the frame. */ | /* Only draw the frame. */ | ||||
| float mat[4][4]; | float mat[4][4]; | ||||
| if (is_stereo3d_view) { | if (is_stereo3d_view) { | ||||
| const bool is_left = v3d->multiview_eye == STEREO_LEFT_ID; | const bool is_left = v3d->multiview_eye == STEREO_LEFT_ID; | ||||
| const char *view_name = is_left ? STEREO_LEFT_NAME : STEREO_RIGHT_NAME; | const char *view_name = is_left ? STEREO_LEFT_NAME : STEREO_RIGHT_NAME; | ||||
| BKE_camera_multiview_model_matrix(&scene->r, ob, view_name, mat); | BKE_camera_multiview_model_matrix(&scene->r, ob, view_name, mat); | ||||
| const float shiftx = BKE_camera_multiview_shift_x(&scene->r, ob, view_name); | |||||
| cam->runtime.drw_corners[0][0][0] += shiftx; | |||||
| cam->runtime.drw_corners[0][1][0] += shiftx; | |||||
| cam->runtime.drw_corners[0][2][0] += shiftx; | |||||
| cam->runtime.drw_corners[0][3][0] += shiftx; | |||||
| } | } | ||||
| else { | else { | ||||
| copy_m4_m4(mat, ob->obmat); | copy_m4_m4(mat, ob->obmat); | ||||
| } | } | ||||
| DRW_shgroup_call_dynamic_add( | DRW_shgroup_call_dynamic_add( | ||||
| sgl->camera_frame, color, cam->runtime.drw_corners[0], | sgl->camera_frame, color, cam->runtime.drw_corners[0], | ||||
| &cam->runtime.drw_depth[0], cam->runtime.drw_tria, mat); | &cam->runtime.drw_depth[0], cam->runtime.drw_tria, mat); | ||||
| ▲ Show 20 Lines • Show All 1,510 Lines • Show Last 20 Lines | |||||