From f9232c080d1f0ac5da6b9ab6a5f28aac0d91469f Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Wed, 10 Jul 2019 11:06:14 +0200 Subject: 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 --- source/blender/draw/intern/draw_manager.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/draw/intern/draw_manager.c') diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 2a241264988..dca6af74a9d 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -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; -- cgit v1.2.3