Commit: 3faa0e6c548a4df67ca4e0fe5f966d9a6f0ef083
Author: Antonio Vazquez
Date:   Mon Jun 11 11:38:27 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB3faa0e6c548a4df67ca4e0fe5f966d9a6f0ef083

Fix segment fault in weight paint for 2.8 old files

This code would be moved to versioning code after merge, but now it's required 
to manage files created with previous versions of 2.8 (not 2.7x)

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

M       source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c 
b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index feeda9a1909..85b048ab98f 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -560,6 +560,14 @@ Gwn_Batch *DRW_gpencil_get_edlin_geom(bGPDstroke *gps, 
float alpha, short UNUSED
 
        /* Draw all the stroke lines (selected or not) */
        bGPDspoint *pt = gps->points;
+
+       /* GPXX: for some converted files, this struct could be null 
+        * maybe we can remove this and move to versioning code after 
+        * merge */
+       if (gps->dvert == NULL) {
+               gps->dvert = MEM_callocN(sizeof(MDeformVert) * gps->totpoints, 
"gp_stroke_weights");
+       }
+
        MDeformVert *dvert = gps->dvert;
 
        int idx = 0;

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

Reply via email to