Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/overlay/overlay_sculpt.c
| Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | void OVERLAY_sculpt_cache_populate(OVERLAY_Data *vedata, Object *ob) | ||||
| OVERLAY_PrivateData *pd = vedata->stl->pd; | OVERLAY_PrivateData *pd = vedata->stl->pd; | ||||
| const DRWContextState *draw_ctx = DRW_context_state_get(); | const DRWContextState *draw_ctx = DRW_context_state_get(); | ||||
| PBVH *pbvh = ob->sculpt->pbvh; | PBVH *pbvh = ob->sculpt->pbvh; | ||||
| const bool use_pbvh = BKE_sculptsession_use_pbvh_draw(ob, draw_ctx->v3d); | const bool use_pbvh = BKE_sculptsession_use_pbvh_draw(ob, draw_ctx->v3d); | ||||
| if (use_pbvh || !ob->sculpt->deform_modifiers_active || ob->sculpt->shapekey_active) { | if (use_pbvh || !ob->sculpt->deform_modifiers_active || ob->sculpt->shapekey_active) { | ||||
| if (!use_pbvh || pbvh_has_mask(pbvh) || pbvh_has_face_sets(pbvh)) { | if (!use_pbvh || pbvh_has_mask(pbvh) || pbvh_has_face_sets(pbvh)) { | ||||
| DRW_shgroup_call_sculpt(pd->sculpt_mask_grp, ob, false, true, false); | DRW_shgroup_call_sculpt(pd->sculpt_mask_grp, ob, false, true); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void OVERLAY_sculpt_draw(OVERLAY_Data *vedata) | void OVERLAY_sculpt_draw(OVERLAY_Data *vedata) | ||||
| { | { | ||||
| OVERLAY_PassList *psl = vedata->psl; | OVERLAY_PassList *psl = vedata->psl; | ||||
| DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); | DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); | ||||
| if (DRW_state_is_fbo()) { | if (DRW_state_is_fbo()) { | ||||
| GPU_framebuffer_bind(dfbl->default_fb); | GPU_framebuffer_bind(dfbl->default_fb); | ||||
| } | } | ||||
| DRW_draw_pass(psl->sculpt_mask_ps); | DRW_draw_pass(psl->sculpt_mask_ps); | ||||
| } | } | ||||