diff options
author | mano-wii <germano.costa@ig.com.br> | 2019-12-30 17:25:09 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2019-12-30 17:25:09 +0300 |
commit | 62d131e962d6e0a4f39db98d4f89243c16c55779 (patch) | |
tree | 4518c31f6d4993eb704335eca65c47f592e9c977 /source/blender/modifiers/intern | |
parent | 3b891989ac41003be2ef5b3b7534f488d14d65ed (diff) |
Fix T72792: Crash with Vertex Groups + Weld Modifier after generative modifiers
Some generative modifiers remove the `CD_MDEFORMVERT` custom layer.
So make sure it exists in the mesh.
Diffstat (limited to 'source/blender/modifiers/intern')
-rw-r--r-- | source/blender/modifiers/intern/MOD_weld.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/modifiers/intern/MOD_weld.c b/source/blender/modifiers/intern/MOD_weld.c index b393cedbd37..9c8579e1cd3 100644 --- a/source/blender/modifiers/intern/MOD_weld.c +++ b/source/blender/modifiers/intern/MOD_weld.c @@ -1629,13 +1629,15 @@ static Mesh *weldModifier_doWeld(WeldModifierData *wmd, const ModifierEvalContex if (defgrp_index != -1) { MDeformVert *dvert, *dv; dvert = CustomData_get_layer(&mesh->vdata, CD_MDEFORMVERT); - dv = &dvert[0]; - v_mask = BLI_BITMAP_NEW(totvert, __func__); - for (i = 0; i < totvert; i++, dv++) { - const bool found = defvert_find_weight(dv, defgrp_index) > 0.0f; - if (found) { - BLI_BITMAP_ENABLE(v_mask, i); - v_mask_act++; + if (dvert) { + dv = &dvert[0]; + v_mask = BLI_BITMAP_NEW(totvert, __func__); + for (i = 0; i < totvert; i++, dv++) { + const bool found = defvert_find_weight(dv, defgrp_index) > 0.0f; + if (found) { + BLI_BITMAP_ENABLE(v_mask, i); + v_mask_act++; + } } } } |