diff options
author | Antonioya <blendergit@gmail.com> | 2018-09-19 18:26:09 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-09-19 18:26:09 +0300 |
commit | e81f7f25acb0687a3d037fa7e39420bc4a6d23a8 (patch) | |
tree | 3054539aa39720b866dd78f77f41088efe960063 | |
parent | 03bb7cd9ad438d5925b84bc6819d83dfe6cbd05e (diff) |
GP: Verify weight data is correct before assigning
5 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c index 1ba2a08acdb..08416f061fe 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c @@ -249,7 +249,7 @@ static void deformStroke( /* loop points and apply deform */ for (int i = 0; i < gps->totpoints; i++) { bGPDspoint *pt = &gps->points[i]; - MDeformVert *dvert = &gps->dvert[i]; + MDeformVert *dvert = gps->dvert != NULL ? &gps->dvert[i] : NULL; /* verify vertex group */ const float weight = get_modifier_point_weight(dvert, (mmd->flag & GP_HOOK_INVERT_VGROUP) != 0, def_nr); diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c index 55836dce1cd..98bb579c662 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c @@ -94,7 +94,7 @@ static void deformStroke( for (int i = 0; i < gps->totpoints; i++) { bGPDspoint *pt = &gps->points[i]; - MDeformVert *dvert = &gps->dvert[i]; + MDeformVert *dvert = gps->dvert != NULL ? &gps->dvert[i] : NULL; /* verify vertex group */ const float weight = get_modifier_point_weight(dvert, (mmd->flag & GP_LATTICE_INVERT_VGROUP) != 0, def_nr); diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c b/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c index f59056b2845..cc2e00ecc22 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c @@ -86,7 +86,7 @@ static void deformStroke( for (int i = 0; i < gps->totpoints; i++) { bGPDspoint *pt = &gps->points[i]; - MDeformVert *dvert = &gps->dvert[i]; + MDeformVert *dvert = gps->dvert != NULL ? &gps->dvert[i] : NULL; /* verify vertex group */ const float weight = get_modifier_point_weight(dvert, (mmd->flag & GP_OFFSET_INVERT_VGROUP) != 0, def_nr); diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c index 19e3b1bb384..6314c51027e 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c @@ -107,7 +107,7 @@ static void deformStroke( if (mmd->factor > 1.0f) { for (int i = 0; i < gps->totpoints; i++) { bGPDspoint *pt = &gps->points[i]; - MDeformVert *dvert = &gps->dvert[i]; + MDeformVert *dvert = gps->dvert != NULL ? &gps->dvert[i] : NULL; /* verify vertex group */ const float weight = get_modifier_point_weight(dvert, (mmd->flag & GP_OPACITY_INVERT_VGROUP) != 0, def_nr); diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c index d6a0721129d..cd46ed0f2d6 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c @@ -80,8 +80,7 @@ static void deformStroke( if (mmd->factor > 0.0f) { for (int r = 0; r < mmd->step; r++) { for (int i = 0; i < gps->totpoints; i++) { - // bGPDspoint *pt = &gps->points[i]; - MDeformVert *dvert = &gps->dvert[i]; + MDeformVert *dvert = gps->dvert != NULL ? &gps->dvert[i] : NULL; /* verify vertex group */ const float weight = get_modifier_point_weight( |