here is a camera jitter python script which worked with python 2.2, but appears to be completely broken in 2.5 (OSX). hopefully it’s okay to post it…
what would i need to change to get it running with python 2.5 ?
#!BPY
“”"
Name: ‘Camera Jitter’
Blender: 241
Group: ‘Animation’
Tooltip: ‘Adds Random movement to the current camera.’
“”"
--------------------------------------------------------------------------
***** BEGIN GPL LICENSE BLOCK *****
Copyright © 2006 Mariano Hidalgo
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
***** END GPL LICENCE BLOCK *****
--------------------------------------------------------------------------
import Blender
from Blender import Scene, Noise
try:
import nt
os = nt
os.sep=’\’
except:
import posix
os = posix
os.sep=’/’
def init():
This controls jitter speed
Blender.sl = 0.025
This controls the amount of position jitter
Blender.sp = 0.1
This controls the amount of rotation jitter
Blender.sr = 0.25
This Boolean controls wheter the jitter is always on or just when moving
Blender.moving = 0
def slink_mode():
time = Blender.Get(‘curtime’)
ob = Scene.GetCurrent().getCurrentCamera()
if Blender.moving:
Blender.ps = (Blender.slob.LocX, Blender.slob.LocY, Blender.slob.LocZ)
else:
Blender.ps = (Blender.sltime, Blender.sltime, Blender.sltime)
rv = Noise.vTurbulence(Blender.ps, 3, 0, Noise.NoiseTypes.NEWPERLIN)
ob.dloc = (Blender.sprv[0], Blender.sprv[1], Blender.sprv[2])
ob.drot = (Blender.srrv[0], Blender.srrv[1], Blender.srrv[2])
def script_mode():
try:
Blender.Text.Load(Blender.Get(“scriptsdir”) + os.sep +“camera_jitter.py”)
except:
Blender.Text.Load(Blender.Get(“uscriptsdir”) + os.sep + “camera_jitter.py”)
scn = Scene.GetCurrent()
scn.clearScriptLinks([‘camera_jitter.py’])
scn.addScriptLink(‘camera_jitter.py’, ‘Redraw’)
def show_prefs():
text = Blender.Draw.Create("")
jitterSpeed = Blender.Draw.Create(Blender.sl)
positionJitter = Blender.Draw.Create(Blender.sp)
rotationJitter = Blender.Draw.Create(Blender.sr)
mov = Blender.Draw.Create(Blender.moving)
block = []
block.append(“The Jitter Speed”)
block.append((“Jitter Speed”, jitterSpeed, 0.005, 0.500))
block.append(“Amount of POS Jitter”)
block.append((“Position Jitter”, positionJitter, 0.1, 2.0))
block.append(“Amount of ROT Jitter”)
block.append((“Rotation Jitter”, rotationJitter, 0.05, 1.00))
block.append((“Only When Moving”, mov, “Add random movement only when camera moves?”))
retval = Blender.Draw.PupBlock(“Camera Noise Preferences” , block)
if retval:
Blender.sl = jitterSpeed.val
Blender.sp = positionJitter.val
Blender.sr = rotationJitter.val
Blender.moving = mov.val
if Blender.link:
slink_mode()
else:
script_mode()
try:
print Blender.sl
except:
init()
show_prefs()


