Script for randomising keys around given IPO curve

I’ve searched both Blender’s script catalog and the forum, but can’t find the following:

Assume I have an IPO curve, be it loc, rot or size. Let’s say I have keys at around every 25 frames. Is there a script that I can use to:

  • Randomize the loc, rot or size per frame? In other words, it must insert random IPO y-values around the existing IPO curve within a certain max and min range.
  • Preferably also control the frequency at which the randomness occurs: e.g. let’s say I don’t want it to randomly jump from close to the max to the min random value from 1 frame to the other, but over 10 frames.
  • Limit the start and end frame within which it must accomplish this?I know about the included “object_random_loc_sz_rot.py” script, but that gives me an instantaneous value for a single frame, but I don’t think one can use it to accomplish the above (except, of course, within another script).

One can obviously use this for camera jitter, but also to put “life” into static, dead characters - without hand-keying every movement.

I do not know python. (I own Chun’s “Core Python programming”, but I have not yet had time to start on it…)

Thanks

Hi AnyMation

import Blender as B
import random as R
x = 3 #CHANGE THIS
ob = B.Object.Get(“Cube”) #OBJECT TO FOLLOW
a = ob.loc
locx = a[0]
print a[0] #line for development
locy = a[1]
locz = a[2]
ob = B.Object.Get(“Sphere”) #OBJECT THAT FOLLOWS + RANDOM motion
#generate random numbers
rx = R.randint(-x,x)/10.0
ry = R.randint(-x,x)/10.0
rz = R.randint(-x,x)/10.0

combine random and location

rx_ = rx + locx
ry_ = ry + locy
rz_ = rz + locz
#assign location
ob = B.Object.Get(“Sphere”)
ob.LocX = rx_
ob.LocY = ry_
ob.LocZ = rz_

maybe that is of some help on this, since you got the book.
You would always have to change though object names and
the amount of movement variable. There is no frequency though
and its only location, no rotation.

in addition it works on a copy of object, sort of.
well on object that is parented to object thats got the main movement.

this is a big help to my script too, converting a bezier curve path into a set of Ipo curves