DRW: Fix Crash in DRW_draw_depth_object when object batch cache is not init

This can happen if the viewport is not redrawn before calling an operator
(frequent in python scripting).

Related to T64805
This commit is contained in:
Clément Foucault 2019-07-01 15:45:16 +02:00
parent 2698544db2
commit 28fee762ae
1 changed files with 2 additions and 0 deletions

View File

@ -2590,6 +2590,8 @@ void DRW_draw_depth_object(ARegion *ar, GPUViewport *viewport, Object *object)
world_clip_planes = rv3d->clip_local;
}
drw_batch_cache_validate(object);
switch (object->type) {
case OB_MESH: {
GPUBatch *batch;