DrawManager: Crash Face Selection

Init the scene of the draw context when selecting. When using face dot selection on
when the subsurf modifier is active on the cage, the scene needs to be
valid. It is read from the context in the
`DRW_mesh_batch_cache_create_requested` and used in the `isDisabled`
method of the SubSurfModifier.

Reviewers: fclem, sergey

Differential Revision: https://developer.blender.org/D5214
This commit is contained in:
Jeroen Bakker 2019-07-10 11:06:14 +02:00
parent 6f1190cbf0
commit f9232c080d
1 changed files with 8 additions and 0 deletions

View File

@ -2730,6 +2730,14 @@ void DRW_draw_select_id_object(Scene *scene,
select_mode = ts->selectmode;
}
/* Init the scene of the draw context. When using face dot selection on
* when the subsurf modifier is active on the cage, the scene needs to be
* valid. It is read from the context in the
* `DRW_mesh_batch_cache_create_requested` and used in the `isDisabled`
* method of the SubSurfModifier. */
DRWContextState *draw_ctx = &DST.draw_ctx;
draw_ctx->scene = scene;
GPU_matrix_mul(ob->obmat);
const float(*world_clip_planes)[4] = NULL;