diff options
author | Matt Ebb <matt@mke3.net> | 2006-09-25 09:15:19 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2006-09-25 09:15:19 +0400 |
commit | 2e7aa1dbf5fbc982e4b0aa43c910a1e92dbd103b (patch) | |
tree | 312d4c9e1e51901ff238f760c305f418ce9cc5b4 /source/blender/src/transform_generics.c | |
parent | 7fce181d1185b0ce083dbbf795e381e6dfc429a6 (diff) |
* Proportional edit mode 'random' falloff
This is another proportional edit falloff that slightly randomises the
influence. It's not strictly random, it's blended with linear falloff so that
it's a bit smoother. The nice thing is that it works with all transforms, axis
locking etc, including the special ones like to sphere, shrink/fatten/etc. It
can be used for all sorts of things like roughening surfaces. I most recently
used it to add a bit of randomness to the folds of some cloth. I
made a short demo video here: http://mke3.net/blender/etc/prop_random-h264.mov
Also included nicer icons for the falloff types.
Diffstat (limited to 'source/blender/src/transform_generics.c')
-rwxr-xr-x | source/blender/src/transform_generics.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/src/transform_generics.c b/source/blender/src/transform_generics.c index f148be83be1..09ad6e7a788 100755 --- a/source/blender/src/transform_generics.c +++ b/source/blender/src/transform_generics.c @@ -88,6 +88,7 @@ #include "BLI_arithb.h" #include "BLI_blenlib.h" #include "BLI_editVert.h" +#include "BLI_rand.h" #include "blendef.h" @@ -888,6 +889,10 @@ void calculatePropRatio(TransInfo *t) case PROP_SPHERE: td->factor = (float)sqrt(2*dist - dist * dist); break; + case PROP_RANDOM: + BLI_srand( BLI_rand() ); /* random seed */ + td->factor = BLI_frand()*dist; + break; default: td->factor = 1; } @@ -912,6 +917,9 @@ void calculatePropRatio(TransInfo *t) case PROP_SPHERE: strcpy(t->proptext, "(Sphere)"); break; + case PROP_RANDOM: + strcpy(t->proptext, "(Random)"); + break; default: strcpy(t->proptext, ""); } |