diff options
author | Antonioya <blendergit@gmail.com> | 2018-09-14 17:08:54 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-09-14 17:09:10 +0300 |
commit | cfaf92c0790f04e526339a1049a321f927f10118 (patch) | |
tree | 91ccad215de1379d865d5bebfc595ff5b55fe1fb /source/blender/draw | |
parent | c4ef2e2f2ebcd9967aa5d4b283ac7abe51156d51 (diff) |
GP: Fix T56802 - Add/Delete Vertex Group crashes
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 079f76aad28..00235d0bfcb 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c @@ -507,7 +507,7 @@ GPUBatch *DRW_gpencil_get_edit_geom(bGPDstroke *gps, float alpha, short dflag) for (int i = 0; i < gps->totpoints; i++, pt++) { /* weight paint */ if (is_weight_paint) { - float weight = gps->dvert ? defvert_find_weight(dvert, vgindex) : 0.0f; + float weight = (dvert && dvert->dw) ? defvert_find_weight(dvert, vgindex) : 0.0f; float hue = 2.0f * (1.0f - weight) / 3.0f; hsv_to_rgb(hue, 1.0f, 1.0f, &selectColor[0], &selectColor[1], &selectColor[2]); selectColor[3] = 1.0f; @@ -585,7 +585,7 @@ GPUBatch *DRW_gpencil_get_edlin_geom(bGPDstroke *gps, float alpha, short UNUSED( for (int i = 0; i < gps->totpoints; i++, pt++) { /* weight paint */ if (is_weight_paint) { - float weight = gps->dvert ? defvert_find_weight(dvert, vgindex) : 0.0f; + float weight = (dvert && dvert->dw) ? defvert_find_weight(dvert, vgindex) : 0.0f; float hue = 2.0f * (1.0f - weight) / 3.0f; hsv_to_rgb(hue, 1.0f, 1.0f, &selectColor[0], &selectColor[1], &selectColor[2]); selectColor[3] = 1.0f; |