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:
authorJoshua Leung <aligorith@gmail.com>2009-10-26 14:10:04 +0300
committerJoshua Leung <aligorith@gmail.com>2009-10-26 14:10:04 +0300
commitb2f96720786a1440f0e22fed414efcde283a07c8 (patch)
tree812ddd79c1143bac6d19bc6cd1058e74ec295ea2 /source/blender/blenkernel/intern/fmodifier.c
parent39d62a12d94d492186b22c1381eb78641a7ee1b7 (diff)
Animation Bugfixes - Noise Modifier + Graph Editor:
* #19727: Noise modifier does nothing with size 1.0 When the 'Size' and 'Phase' parameters were both 1.0 exactly, and evaltime was an integer (as is the case when doing animation evaluation but not for Graph Editor drawing), the noise calculation function was bailing out. Now, the 'z' component supplied to this function is a decimal value (hardcoded to 0.1 after experimentation) to try and avoid this situation. * Graph Editor 'Bake' operator was using wrong poll callback, making it useless when trying to use it on a F-Curve that only has modifiers on it (i.e. the main use case of the operator!)
Diffstat (limited to 'source/blender/blenkernel/intern/fmodifier.c')
-rw-r--r--source/blender/blenkernel/intern/fmodifier.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index 64558d0b456..4e79f6238b5 100644
--- a/source/blender/blenkernel/intern/fmodifier.c
+++ b/source/blender/blenkernel/intern/fmodifier.c
@@ -715,8 +715,13 @@ static void fcm_noise_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, floa
FMod_Noise *data= (FMod_Noise *)fcm->data;
float noise;
- noise = BLI_turbulence(data->size, evaltime, data->phase, 0.f, data->depth);
+ /* generate noise using good ol' Blender Noise
+ * - 0.1 is passed as the 'z' value, otherwise evaluation fails for size = phase = 1
+ * with evaltime being an integer (which happens when evaluating on frame by frame basis)
+ */
+ noise = BLI_turbulence(data->size, evaltime, data->phase, 0.1f, data->depth);
+ /* combine the noise with existing motion data */
switch (data->modification) {
case FCM_NOISE_MODIF_ADD:
*cvalue= *cvalue + noise * data->strength;