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 | |
parent | 0198df7956125180d5b9c50638a0778a3236d88f (diff) | |
parent | df51fd74cf826c42a90212082abb27e99484257a (diff) |
svn merge ^/trunk/blender -r43564:43609
Diffstat (limited to 'source/blender/modifiers')
4 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.c b/source/blender/modifiers/intern/MOD_fluidsim_util.c index b5439d4103b..6cf2b07142d 100644 --- a/source/blender/modifiers/intern/MOD_fluidsim_util.c +++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c @@ -95,6 +95,7 @@ void fluidsim_init(FluidsimModifierData *fluidmd) fss->animStart = 0.0; fss->animEnd = 4.0; + fss->animRate = 1.0; fss->gstar = 0.005; // used as normgstar fss->maxRefine = -1; // maxRefine is set according to resolutionxyz during bake diff --git a/source/blender/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c index 473692f123d..e3eec5243fb 100644 --- a/source/blender/modifiers/intern/MOD_weightvgedit.c +++ b/source/blender/modifiers/intern/MOD_weightvgedit.c @@ -204,6 +204,17 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der return dm; 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 this modifier is not allowed to add vertices, just return. */ + if(!do_add) + return dm; + /* Else, add a valid data layer! */ + dvert = CustomData_add_layer_named(&dm->vertData, CD_MDEFORMVERT, CD_CALLOC, + NULL, numVerts, wmd->defgrp_name); + /* Ultimate security check. */ + if(!dvert) + return dm; /* Get org weights, assuming 0.0 for vertices not in given vgroup. */ org_w = MEM_mallocN(sizeof(float) * numVerts, "WeightVGEdit Modifier, org_w"); 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"); diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c index 22128784dda..bdcd4083a3a 100644 --- a/source/blender/modifiers/intern/MOD_weightvgproximity.c +++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c @@ -378,6 +378,10 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der return dm; 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. + * As this modifier never add vertices to vgroup, just return. */ + if(!dvert) + return dm; /* Find out which vertices to work on (all vertices in vgroup), and get their relevant weight. */ |