[Bf-blender-cvs] [44fc8aa2216] master: Fix T64403: crash sampling coloring in texture paint mode

Brecht Van Lommel noreply at git.blender.org
Mon May 13 11:50:48 CEST 2019


Commit: 44fc8aa2216314c1e9418a85140c86bf6bc587bf
Author: Brecht Van Lommel
Date:   Mon May 13 11:45:16 2019 +0200
Branches: master
https://developer.blender.org/rB44fc8aa2216314c1e9418a85140c86bf6bc587bf

Fix T64403: crash sampling coloring in texture paint mode

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

M	source/blender/editors/space_view3d/drawobject.c

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

diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 638c77fc3cb..fbec99c5f28 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -221,6 +221,8 @@ static void bbs_mesh_solid_verts(Depsgraph *UNUSED(depsgraph),
 {
   Mesh *me = ob->data;
 
+  DRW_mesh_batch_cache_validate(me);
+
   GPUBatch *geom_faces = DRW_mesh_batch_cache_get_triangles_with_select_id(me);
   GPUBatch *geom_verts = DRW_mesh_batch_cache_get_verts_with_select_id(me);
   DRW_mesh_batch_cache_create_requested(ob, me, NULL, false, true);
@@ -239,6 +241,8 @@ static void bbs_mesh_solid_faces(Scene *UNUSED(scene),
   Mesh *me = ob->data;
   Mesh *me_orig = DEG_get_original_object(ob)->data;
 
+  DRW_mesh_batch_cache_validate(me);
+
   const bool use_hide = (me_orig->editflag & ME_EDIT_PAINT_FACE_SEL);
   GPUBatch *geom_faces = DRW_mesh_batch_cache_get_triangles_with_select_id(me);
   DRW_mesh_batch_cache_create_requested(ob, me, NULL, false, use_hide);
@@ -275,6 +279,8 @@ void draw_object_select_id(Depsgraph *depsgraph,
         const bool draw_facedot = check_ob_drawface_dot(scene, v3d, ob->dt);
         const bool use_faceselect = (select_mode & SCE_SELECT_FACE) != 0;
 
+        DRW_mesh_batch_cache_validate(me);
+
         BM_mesh_elem_table_ensure(em->bm, BM_VERT | BM_EDGE | BM_FACE);
 
         GPUBatch *geom_faces, *geom_edges, *geom_verts, *geom_facedots;



More information about the Bf-blender-cvs mailing list