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:
authorMatt Ebb <matt@mke3.net>2009-05-02 08:20:36 +0400
committerMatt Ebb <matt@mke3.net>2009-05-02 08:20:36 +0400
commit4b025d68657c197b302516b96f69405aa957accf (patch)
tree1bfd149869f57c1caca4a022659ed016fe60b455 /source/blender/editors/space_graph
parent76cedc4b9abe5a50db03a1ccd1875213effae264 (diff)
* Added a new F-Curve modifier type: Noise
Thanks Aligorith for making such an easy to use system! http://mke3.net/blender/devel/2.5/fcurve_noise_modifier.mov
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r--source/blender/editors/space_graph/graph_buttons.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c
index 357079a2c3c..9c7c3c3e812 100644
--- a/source/blender/editors/space_graph/graph_buttons.c
+++ b/source/blender/editors/space_graph/graph_buttons.c
@@ -460,7 +460,7 @@ static void draw_modifier__generator(uiBlock *block, FCurve *fcu, FModifier *fcm
/* closing bracket and '+' sign */
if ( (i != (data->poly_order - 1)) || ((i==0) && data->poly_order==2) )
- uiDefBut(block, LABEL, 1, ") ×", 280, cy, 30, 20, NULL, 0.0, 0.0, 0, 0, "");
+ uiDefBut(block, LABEL, 1, ") â—Š", 280, cy, 30, 20, NULL, 0.0, 0.0, 0, 0, "");
else
uiDefBut(block, LABEL, 1, ")", 280, cy, 30, 20, NULL, 0.0, 0.0, 0, 0, "");
@@ -571,6 +571,36 @@ static void draw_modifier__cycles(uiBlock *block, FCurve *fcu, FModifier *fcm, i
/* --------------- */
+/* draw settings for noise modifier */
+static void draw_modifier__noise(uiBlock *block, FCurve *fcu, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col)
+{
+ FMod_Noise *data= (FMod_Noise *)fcm->data;
+ int cy= (*yco - 30), cy1= (*yco - 50), cy2= (*yco - 70);
+ char cyc_mode[]="Modification %t|Replace %x0|Add %x1|Subtract %x2|Multiply %x3";
+
+ /* set the height */
+ (*height) = 80;
+
+ /* basic settings (backdrop + some padding) */
+ DRAW_BACKDROP((*height));
+
+ uiDefButS(block, MENU, B_FMODIFIER_REDRAW, cyc_mode,
+ 3, cy, 150, 20, &data->modification, 0, 0, 0, 0, "Method of modifying the existing F-Curve use before first keyframe");
+
+ uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Size:",
+ 3, cy1, 150, 20, &data->size, 0.000001, 10000.0, 0.01, 3, "");
+ uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Strength:",
+ 3, cy2, 150, 20, &data->strength, 0.0, 10000.0, 0.01, 3, "");
+
+ uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Phase:",
+ 155, cy1, 150, 20, &data->phase, 0.0, 100000.0, 0.1, 3, "");
+ uiDefButS(block, NUM, B_FMODIFIER_REDRAW, "Depth:",
+ 155, cy2, 150, 20, &data->depth, 0, 128, 1, 3, "");
+
+}
+
+/* --------------- */
+
#define BINARYSEARCH_FRAMEEQ_THRESH 0.0001
/* Binary search algorithm for finding where to insert Envelope Data Point.
@@ -880,6 +910,10 @@ static void graph_panel_modifier_draw(uiBlock *block, FCurve *fcu, FModifier *fc
draw_modifier__limits(block, fcu, fcm, yco, &height, width, active, rb_col);
break;
+ case FMODIFIER_TYPE_NOISE: /* Noise */
+ draw_modifier__noise(block, fcu, fcm, yco, &height, width, active, rb_col);
+ break;
+
default: /* unknown type */
height= 96;
//DRAW_BACKDROP(height); // XXX buggy...