Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/overlay/overlay_sculpt.c
| Show All 16 Lines | |||||
| */ | */ | ||||
| /** \file | /** \file | ||||
| * \ingroup draw_engine | * \ingroup draw_engine | ||||
| */ | */ | ||||
| #include "DRW_render.h" | #include "DRW_render.h" | ||||
| #include "DNA_mesh_types.h" | |||||
| #include "draw_cache_impl.h" | #include "draw_cache_impl.h" | ||||
| #include "overlay_private.h" | #include "overlay_private.h" | ||||
| #include "BKE_paint.h" | #include "BKE_paint.h" | ||||
| #include "BKE_pbvh.h" | #include "BKE_pbvh.h" | ||||
| #include "BKE_subdiv_ccg.h" | #include "BKE_subdiv_ccg.h" | ||||
| void OVERLAY_sculpt_cache_init(OVERLAY_Data *vedata) | void OVERLAY_sculpt_cache_init(OVERLAY_Data *vedata) | ||||
| Show All 33 Lines | if (!pbvh_has_mask(pbvh) && !pbvh_has_face_sets(pbvh)) { | ||||
| * is nothing to draw. */ | * is nothing to draw. */ | ||||
| return; | return; | ||||
| } | } | ||||
| if (use_pbvh) { | if (use_pbvh) { | ||||
| DRW_shgroup_call_sculpt(pd->sculpt_mask_grp, ob, false, true); | DRW_shgroup_call_sculpt(pd->sculpt_mask_grp, ob, false, true); | ||||
| } | } | ||||
| else { | else { | ||||
| Mesh *mesh = ob->data; | |||||
| BKE_pbvh_update_normals(pbvh, mesh->runtime.subdiv_ccg); | |||||
| sculpt_overlays = DRW_mesh_batch_cache_get_sculpt_overlays(ob->data); | sculpt_overlays = DRW_mesh_batch_cache_get_sculpt_overlays(ob->data); | ||||
| if (sculpt_overlays) { | if (sculpt_overlays) { | ||||
| DRW_shgroup_call(pd->sculpt_mask_grp, sculpt_overlays, ob); | DRW_shgroup_call(pd->sculpt_mask_grp, sculpt_overlays, ob); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void OVERLAY_sculpt_draw(OVERLAY_Data *vedata) | void OVERLAY_sculpt_draw(OVERLAY_Data *vedata) | ||||
| Show All 11 Lines | |||||