* 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.
This commit is contained in:
2006-09-25 05:15:19 +00:00
parent 7fce181d11
commit 2e7aa1dbf5
6 changed files with 1839 additions and 1965 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 57 KiB

View File

@@ -533,6 +533,7 @@ typedef struct Scene {
#define PROP_SHARP 3
#define PROP_LIN 4
#define PROP_CONST 5
#define PROP_RANDOM 6
/* return flag next_object function */
#define F_START 0

File diff suppressed because it is too large Load Diff

View File

@@ -2252,6 +2252,8 @@ static uiBlock *view3d_edit_propfalloffmenu(void *arg_unused)
else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Sharp|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SHARP, "");
if (G.scene->prop_mode==PROP_LIN) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Linear|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_LIN, "");
else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Linear|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_LIN, "");
if (G.scene->prop_mode==PROP_RANDOM) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Random|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_RANDOM, "");
else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Random|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_RANDOM, "");
if (G.scene->prop_mode==PROP_CONST) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Constant|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_CONST, "");
else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Constant|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_CONST, "");
@@ -4187,6 +4189,7 @@ static char *propfalloff_pup(void)
str += sprintf(str, "%s", "|Root Falloff%x2");
str += sprintf(str, "%s", "|Sharp Falloff%x3");
str += sprintf(str, "%s", "|Linear Falloff%x4");
str += sprintf(str, "%s", "|Random Falloff%x6");
str += sprintf(str, "%s", "|Constant, No Falloff%x5");
return string;
}

View File

@@ -4168,7 +4168,7 @@ static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break;
case OKEY:
if (G.qual==LR_SHIFTKEY) {
G.scene->prop_mode = (G.scene->prop_mode+1)%6;
G.scene->prop_mode = (G.scene->prop_mode+1)%7;
allqueue(REDRAWHEADERS, 0);
}
else if((G.qual==0)) {

View File

@@ -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, "");
}