Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/modifiers/intern/MOD_weightvgedit.c')
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgedit.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c
index 779ac6b5ecf..dd84dce05c2 100644
--- a/source/blender/modifiers/intern/MOD_weightvgedit.c
+++ b/source/blender/modifiers/intern/MOD_weightvgedit.c
@@ -29,6 +29,7 @@
*/
#include "BLI_utildefines.h"
+#include "BLI_ghash.h"
#include "BLI_math.h"
#include "BLI_string.h"
@@ -239,7 +240,15 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
/* Do mapping. */
if (wmd->falloff_type != MOD_WVG_MAPPING_NONE) {
- weightvg_do_map(numVerts, new_w, wmd->falloff_type, wmd->cmap_curve);
+ RNG *rng = NULL;
+
+ if (wmd->falloff_type == MOD_WVG_MAPPING_RANDOM)
+ rng = BLI_rng_new_srandom(BLI_ghashutil_strhash(ob->id.name));
+
+ weightvg_do_map(numVerts, new_w, wmd->falloff_type, wmd->cmap_curve, rng);
+
+ if (rng)
+ BLI_rng_free(rng);
}
/* Do masking. */