Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/overlay/overlay_outline.c
| Show First 20 Lines • Show All 266 Lines • ▼ Show 20 Lines | BKE_gpencil_visible_stroke_iter(NULL, | ||||
| ob, | ob, | ||||
| gpencil_layer_cache_populate, | gpencil_layer_cache_populate, | ||||
| gpencil_stroke_cache_populate, | gpencil_stroke_cache_populate, | ||||
| &iter, | &iter, | ||||
| false, | false, | ||||
| pd->cfra); | pd->cfra); | ||||
| } | } | ||||
| static void OVERLAY_outline_volume(OVERLAY_PrivateData *pd, Object *ob) | |||||
| { | |||||
| struct GPUBatch *geom = DRW_cache_volume_selection_surface_get(ob); | |||||
| if (geom == NULL) { | |||||
| return; | |||||
| } | |||||
| DRWShadingGroup *shgroup = pd->outlines_grp; | |||||
| DRW_shgroup_call(shgroup, geom, ob); | |||||
| } | |||||
| void OVERLAY_outline_cache_populate(OVERLAY_Data *vedata, | void OVERLAY_outline_cache_populate(OVERLAY_Data *vedata, | ||||
| Object *ob, | Object *ob, | ||||
| OVERLAY_DupliData *dupli, | OVERLAY_DupliData *dupli, | ||||
| bool init_dupli) | bool init_dupli) | ||||
| { | { | ||||
| 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(); | ||||
| struct GPUBatch *geom; | struct GPUBatch *geom; | ||||
| DRWShadingGroup *shgroup = NULL; | DRWShadingGroup *shgroup = NULL; | ||||
| const bool draw_outline = ob->dt > OB_BOUNDBOX; | const bool draw_outline = ob->dt > OB_BOUNDBOX; | ||||
| /* Early exit: outlines of bounding boxes are not drawn. */ | /* Early exit: outlines of bounding boxes are not drawn. */ | ||||
| if (!draw_outline) { | if (!draw_outline) { | ||||
| return; | return; | ||||
| } | } | ||||
| if (ob->type == OB_GPENCIL) { | if (ob->type == OB_GPENCIL) { | ||||
| OVERLAY_outline_gpencil(pd, ob); | OVERLAY_outline_gpencil(pd, ob); | ||||
| return; | return; | ||||
| } | } | ||||
| if (ob->type == OB_VOLUME) { | |||||
| OVERLAY_outline_volume(pd, ob); | |||||
| return; | |||||
| } | |||||
| if (ob->type == OB_POINTCLOUD && pd->wireframe_mode) { | if (ob->type == OB_POINTCLOUD && pd->wireframe_mode) { | ||||
| /* Looks bad in this case. Could be relaxed if we draw a | /* Looks bad in this case. Could be relaxed if we draw a | ||||
| * wireframe of some sort in the future. */ | * wireframe of some sort in the future. */ | ||||
| return; | return; | ||||
| } | } | ||||
| if (dupli && !init_dupli) { | if (dupli && !init_dupli) { | ||||
| geom = dupli->outline_geom; | geom = dupli->outline_geom; | ||||
| ▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines | |||||