Wiggle Effect

hey guys,
Okay, so I was playing around with after effects a few days ago and I noticed that I use the Wiggle feature allot. And then I thought, wouldn’t it be easier to do all of my graphics in blender but I don’t want to have to keyframe all the random movement.
It would be really cool if someone could make a small pyscript that would do that.
Ether by auto key framing it for you or just as a baked animation. For those who are not familiar with After Effects the wiggle feature is goes like this: wiggle(2,100)

The first variable (in this case 2) is the speed at which it will perform the wiggle and the second one (100) is the distance. You just type it into your selected attributes box (e.g. pivot x or postion z.ect) and then it will manipulate the value of the axis and the type of transformation for you.

It is a very useful tool for random movement.
I would create it myself but I hardly know any python script at all and i wouldn’t get anywhere with it. :eek:

If someone where to create it i would be really happy :smiley:

Here is my attempt at a wiggle function.

import Blender
import math

def wiggle(passedFrequency, passedAmplitude, passedProbability):
    # Calculate a COS value based upon the passedFrequency.
    localTime = Blender.Get('curtime')
    # See if we should add some randomness to this sample.
    rndCheck = Noise.random()
    if rndCheck < passedProbability:
        r = Noise.random() * passedProbability
        #r = 0.5 - r
        r = r /10.0
        r = 0.0
    r = (math.cos(localTime*(passedFrequency/10.0))+r) * passedAmplitude
    return r

wow. cool! I’l test it out :smiley:

depending on what version of blender you’re using, i have 2 solutions for you:

-if you’re using 2.49 or earlier, i modified a camera jitter script a while back to work for any object:

-if you’re using 2.5, good news! wiggle is built in! when you go to the new graph editor (formerly the ipo editor) you can now add modifiers (including wiggle/noise) to a curve by clicking the properties tab in the top right corner of the graph editor window. i was quite thrilled when i discovered that!