Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_draw_legacy.c
| Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | #endif | ||||
| } | } | ||||
| } | } | ||||
| /* *********************** backdraw for selection *************** */ | /* *********************** backdraw for selection *************** */ | ||||
| /** | /** | ||||
| * \note Only use in object mode. | * \note Only use in object mode. | ||||
| */ | */ | ||||
| static void validate_object_select_id( | static void validate_object_select_id(struct Depsgraph *depsgraph, | ||||
| struct Depsgraph *depsgraph, Scene *scene, ARegion *ar, View3D *v3d, Object *obact) | Scene *scene, | ||||
| ViewLayer *view_layer, | |||||
| ARegion *ar, | |||||
| View3D *v3d, | |||||
| Object *obact) | |||||
| { | { | ||||
| RegionView3D *rv3d = ar->regiondata; | |||||
| Scene *scene_eval = (Scene *)DEG_get_evaluated_id(depsgraph, &scene->id); | |||||
| Object *obact_eval = DEG_get_evaluated_object(depsgraph, obact); | Object *obact_eval = DEG_get_evaluated_object(depsgraph, obact); | ||||
| BLI_assert(ar->regiontype == RGN_TYPE_WINDOW); | BLI_assert(ar->regiontype == RGN_TYPE_WINDOW); | ||||
| if (obact_eval && (obact_eval->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT) || | if (obact_eval && (obact_eval->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT) || | ||||
| BKE_paint_select_face_test(obact_eval))) { | BKE_paint_select_face_test(obact_eval))) { | ||||
| /* do nothing */ | /* do nothing */ | ||||
| } | } | ||||
| Show All 10 Lines | else { | ||||
| return; | return; | ||||
| } | } | ||||
| if (!(v3d->flag & V3D_INVALID_BACKBUF)) { | if (!(v3d->flag & V3D_INVALID_BACKBUF)) { | ||||
| return; | return; | ||||
| } | } | ||||
| if (obact_eval && ((obact_eval->base_flag & BASE_VISIBLE) != 0)) { | if (obact_eval && ((obact_eval->base_flag & BASE_VISIBLE) != 0)) { | ||||
| uint dummy_vert_ofs, dummy_edge_ofs, dummy_face_ofs; | DRW_draw_select_id_object( | ||||
| DRW_framebuffer_select_id_setup(ar, true); | depsgraph, view_layer, ar, v3d, obact, scene->toolsettings->selectmode); | ||||
| DRW_draw_select_id_object(scene_eval, | |||||
| rv3d, | |||||
| obact_eval, | |||||
| scene->toolsettings->selectmode, | |||||
| false, | |||||
| 1, | |||||
| &dummy_vert_ofs, | |||||
| &dummy_edge_ofs, | |||||
| &dummy_face_ofs); | |||||
| DRW_framebuffer_select_id_release(ar); | |||||
| } | } | ||||
| /* TODO: Create a flag in `DRW_manager` because the drawing is no longer | /* TODO: Create a flag in `DRW_manager` because the drawing is no longer | ||||
| * made on the backbuffer in this case. */ | * made on the backbuffer in this case. */ | ||||
| v3d->flag &= ~V3D_INVALID_BACKBUF; | v3d->flag &= ~V3D_INVALID_BACKBUF; | ||||
| } | } | ||||
| /* TODO: Creating, attaching texture, and destroying a framebuffer is quite slow. | /* TODO: Creating, attaching texture, and destroying a framebuffer is quite slow. | ||||
| Show All 18 Lines | static void view3d_opengl_read_Z_pixels(GPUViewport *viewport, rcti *rect, void *data) | ||||
| GPU_framebuffer_free(tmp_fb); | GPU_framebuffer_free(tmp_fb); | ||||
| } | } | ||||
| void ED_view3d_select_id_validate(ViewContext *vc) | void ED_view3d_select_id_validate(ViewContext *vc) | ||||
| { | { | ||||
| /* TODO: Create a flag in `DRW_manager` because the drawing is no longer | /* TODO: Create a flag in `DRW_manager` because the drawing is no longer | ||||
| * made on the backbuffer in this case. */ | * made on the backbuffer in this case. */ | ||||
| if (vc->v3d->flag & V3D_INVALID_BACKBUF) { | if (vc->v3d->flag & V3D_INVALID_BACKBUF) { | ||||
| validate_object_select_id(vc->depsgraph, vc->scene, vc->ar, vc->v3d, vc->obact); | validate_object_select_id( | ||||
| vc->depsgraph, vc->scene, vc->view_layer, vc->ar, vc->v3d, vc->obact); | |||||
| } | } | ||||
| } | } | ||||
| void ED_view3d_backbuf_depth_validate(ViewContext *vc) | void ED_view3d_backbuf_depth_validate(ViewContext *vc) | ||||
| { | { | ||||
| if (vc->v3d->flag & V3D_INVALID_BACKBUF) { | if (vc->v3d->flag & V3D_INVALID_BACKBUF) { | ||||
| ARegion *ar = vc->ar; | ARegion *ar = vc->ar; | ||||
| Object *obact_eval = DEG_get_evaluated_object(vc->depsgraph, vc->obact); | Object *obact_eval = DEG_get_evaluated_object(vc->depsgraph, vc->obact); | ||||
| ▲ Show 20 Lines • Show All 383 Lines • Show Last 20 Lines | |||||