diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-01-22 22:04:35 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-01-22 22:04:35 +0400 |
commit | 4966982a5aa7715e6bd67dcef1babdf8ca3d02e9 (patch) | |
tree | cf96f67b83f89336e3fe2f64aa58345dca818430 /source/blender/modifiers/intern/MOD_weightvgmix.c | |
parent | 0198df7956125180d5b9c50638a0778a3236d88f (diff) | |
parent | df51fd74cf826c42a90212082abb27e99484257a (diff) |
svn merge ^/trunk/blender -r43564:43609
Diffstat (limited to 'source/blender/modifiers/intern/MOD_weightvgmix.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_weightvgmix.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_weightvgmix.c b/source/blender/modifiers/intern/MOD_weightvgmix.c index 316080ba4a7..f549dc7b789 100644 --- a/source/blender/modifiers/intern/MOD_weightvgmix.c +++ b/source/blender/modifiers/intern/MOD_weightvgmix.c @@ -251,6 +251,17 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der } dvert = CustomData_duplicate_referenced_layer(&dm->vertData, CD_MDEFORMVERT, numVerts); + /* If no vertices were ever added to an object's vgroup, dvert might be NULL. */ + if(!dvert) + /* If not affecting all vertices, just return. */ + if(wmd->mix_set != MOD_WVG_SET_ALL) + return dm; + /* Else, add a valid data layer! */ + dvert = CustomData_add_layer_named(&dm->vertData, CD_MDEFORMVERT, CD_CALLOC, + NULL, numVerts, wmd->defgrp_name_a); + /* Ultimate security check. */ + if(!dvert) + return dm; /* Find out which vertices to work on. */ tidx = MEM_mallocN(sizeof(int) * numVerts, "WeightVGMix Modifier, tidx"); |