Commit: f9232c080d1f0ac5da6b9ab6a5f28aac0d91469f
Author: Jeroen Bakker
Date:   Wed Jul 10 11:06:14 2019 +0200
Branches: master
https://developer.blender.org/rBf9232c080d1f0ac5da6b9ab6a5f28aac0d91469f

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

===================================================================

M       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;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to