Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/workbench_effect_dof.c
| Show First 20 Lines • Show All 127 Lines • ▼ Show 20 Lines | void workbench_dof_engine_init(WORKBENCH_Data *vedata) | ||||
| WORKBENCH_TextureList *txl = vedata->txl; | WORKBENCH_TextureList *txl = vedata->txl; | ||||
| WORKBENCH_StorageList *stl = vedata->stl; | WORKBENCH_StorageList *stl = vedata->stl; | ||||
| WORKBENCH_PrivateData *wpd = stl->wpd; | WORKBENCH_PrivateData *wpd = stl->wpd; | ||||
| WORKBENCH_FramebufferList *fbl = vedata->fbl; | WORKBENCH_FramebufferList *fbl = vedata->fbl; | ||||
| const DRWContextState *draw_ctx = DRW_context_state_get(); | const DRWContextState *draw_ctx = DRW_context_state_get(); | ||||
| RegionView3D *rv3d = draw_ctx->rv3d; | RegionView3D *rv3d = draw_ctx->rv3d; | ||||
| View3D *v3d = draw_ctx->v3d; | View3D *v3d = draw_ctx->v3d; | ||||
| Scene *scene = draw_ctx->scene; | |||||
| Object *camera; | Object *camera; | ||||
| if (v3d && rv3d) { | if (v3d && rv3d) { | ||||
| camera = (rv3d->persp == RV3D_CAMOB) ? v3d->camera : NULL; | camera = (rv3d->persp == RV3D_CAMOB) ? v3d->camera : NULL; | ||||
| } | } | ||||
| else { | else { | ||||
| camera = scene->camera; | camera = wpd->cam_original_ob; | ||||
| } | } | ||||
| Camera *cam = camera != NULL ? camera->data : NULL; | Camera *cam = camera != NULL ? camera->data : NULL; | ||||
| if ((wpd->shading.flag & V3D_SHADING_DEPTH_OF_FIELD) == 0 || (cam == NULL) || | if ((wpd->shading.flag & V3D_SHADING_DEPTH_OF_FIELD) == 0 || (cam == NULL) || | ||||
| ((cam->dof.flag & CAM_DOF_ENABLED) == 0)) { | ((cam->dof.flag & CAM_DOF_ENABLED) == 0)) { | ||||
| wpd->dof_enabled = false; | wpd->dof_enabled = false; | ||||
| /* Cleanup. */ | /* Cleanup. */ | ||||
| ▲ Show 20 Lines • Show All 261 Lines • Show Last 20 Lines | |||||