diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2020-09-18 20:30:02 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2020-09-18 20:30:51 +0300 |
commit | 6c9ec1c893f98c2349edd3aaae4b606b55b393c9 (patch) | |
tree | 1a3747a77a7eacd59304143ef717896fb5991371 /source/blender/draw/engines/overlay | |
parent | ea6cd1c8f05b27a81e835251e779f047a3488203 (diff) |
Sculpt: Render Mask and Face Sets with modifiers active
This removes the limitation of the sculpt overlays not being visible
with modifiers active.
Reviewed By: fclem
Maniphest Tasks: T68900
Differential Revision: https://developer.blender.org/D8673
Diffstat (limited to 'source/blender/draw/engines/overlay')
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_sculpt.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_sculpt.c b/source/blender/draw/engines/overlay/overlay_sculpt.c index b36252ead30..c6c617fd29b 100644 --- a/source/blender/draw/engines/overlay/overlay_sculpt.c +++ b/source/blender/draw/engines/overlay/overlay_sculpt.c @@ -22,6 +22,7 @@ #include "DRW_render.h" +#include "draw_cache_impl.h" #include "overlay_private.h" #include "BKE_paint.h" @@ -48,14 +49,21 @@ void OVERLAY_sculpt_cache_populate(OVERLAY_Data *vedata, Object *ob) { OVERLAY_PrivateData *pd = vedata->stl->pd; const DRWContextState *draw_ctx = DRW_context_state_get(); + struct GPUBatch *sculpt_overlays; PBVH *pbvh = ob->sculpt->pbvh; 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 || pbvh_has_mask(pbvh) || pbvh_has_face_sets(pbvh)) { + if (pbvh_has_mask(pbvh) || pbvh_has_face_sets(pbvh)) { + if (use_pbvh) { DRW_shgroup_call_sculpt(pd->sculpt_mask_grp, ob, false, true); } + else { + sculpt_overlays = DRW_mesh_batch_cache_get_sculpt_overlays(ob->data); + if (sculpt_overlays) { + DRW_shgroup_call(pd->sculpt_mask_grp, sculpt_overlays, ob); + } + } } } |