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!)
This commit is contained in:
2009-10-26 11:10:04 +00:00
parent 39d62a12d9
commit b2f9672078
2 changed files with 7 additions and 2 deletions

View File

@@ -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;