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:
authorBassam Kurdali <bassam@urchn.org>2014-02-10 06:23:01 +0400
committerJoshua Leung <aligorith@gmail.com>2014-02-10 07:21:12 +0400
commit5cf987cff8276625735c789f18c9f77c507b70b0 (patch)
treef36aaf8424ffa3c64773918ae4e10bb2f017509f /source/blender/blenkernel/intern/fmodifier.c
parent3432f34d059381546df8b202263a243f0656df38 (diff)
Patch T38282/D295: Add a time offset to the FCurve Noise Modifier
FCurve Noise Modifer now has an extra float property which offsets the noise in time. This is useful for creating follow through in procedurally animated noise. For example, if you've used a noise modifier on a parent bone to add additional movement, a quick and easy way to add overlapping motion is to create copies of that modifier on its children, and then offset the time those curves play at. See this in action at: http://youtu.be/Ph6fk_z_k3k Reviewed By: Joshua Leung
Diffstat (limited to 'source/blender/blenkernel/intern/fmodifier.c')
-rw-r--r--source/blender/blenkernel/intern/fmodifier.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index 6c98808f087..bcbc5571077 100644
--- a/source/blender/blenkernel/intern/fmodifier.c
+++ b/source/blender/blenkernel/intern/fmodifier.c
@@ -785,6 +785,7 @@ static void fcm_noise_new_data(void *mdata)
data->size = 1.0f;
data->strength = 1.0f;
data->phase = 1.0f;
+ data->offset = 0.0f;
data->depth = 0;
data->modification = FCM_NOISE_MODIF_REPLACE;
}
@@ -798,7 +799,7 @@ static void fcm_noise_evaluate(FCurve *UNUSED(fcu), FModifier *fcm, float *cvalu
* - 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);
+ noise = BLI_turbulence(data->size, evaltime - data->offset, data->phase, 0.1f, data->depth);
/* combine the noise with existing motion data */
switch (data->modification) {