Wave effect controled by object?

I was using the wave fx in blender and wondered if this can be accesed through python, if it could would it be possible to have the object, a sphere say, control the wave settings on a plane for instance, so as the sphere connected with the plane the wave fx would be activated, to a more or less degree by how much the shpere and plane intersect, also could the wave origin be effected by the origin of the sphere, so if the sphere moved across the plane the wave would follow.
Also I wondered if the opposite might be possible, so the sphere would bob up and down with the wave?

I do not know python my self, so do not know if this is possible.

Ken :smiley:

Something like this was done with Olikas, but I don’t know where to get it anymore.


Hmmm I already tried Olikas 2.0, with no success :frowning: .

So my question still stands for any python programmers, can it be done or is there a better way perhaps?


# put 'Wave' grid mesh object on a hidden layer
# put 'Boat' mesh object on visible layer

from Blender import Get, NMesh, Object, Material
from math import sqrt, sin, pow, pi

dpi = 2*pi

veloc = 0.8	# velocity
interv = 20	# num. frames to consider in calculus
ampl = 0.3	# amplitude
Lon = 2		# wavelenght
visco = 0.01	# viscosity
Rmin = 0.1	# min. radius
Hmin = 1	# max.Z over Zplane

frame = Get('curframe')

me = NMesh.GetRawFromObject('Wave')
vs = me.verts
obj = Object.Get()
mat = Material.Get()

wmat = []
[wmat.append(m) for m in mat if (m.name[:5] == 'Waves')]
if wmat == []:	wave = Material.New('Waves')
else:		wave = Material.Get('Waves')

for o in obj:
	if (o.name[:4] == 'Boat'):
		curves = o.getIpo()
		for v in vs:
			sum = 0
			for a in range(frame)[-interv:]:
				z = curves.EvaluateCurveOn(2, a)
				if abs(z) &lt; Hmin:
					x = curves.EvaluateCurveOn(0, a)
					y = curves.EvaluateCurveOn(1, a)
					vx = (curves.EvaluateCurveOn(0, a+0.01)-curves.EvaluateCurveOn(0, a-0.01))*50
					vy = (curves.EvaluateCurveOn(1, a+0.01)-curves.EvaluateCurveOn(1, a-0.01))*50
					vz = (curves.EvaluateCurveOn(2, a+0.01)-curves.EvaluateCurveOn(2, a-0.01))*50
					VB = sqrt(vx*vx+vy*vy+vz*vz)
					D = sqrt((v.co[0]-x)*(v.co[0]-x)+(v.co[1]-y)*(v.co[1]-y))
					if(frame-a &gt; D/veloc):
						D = max(D, Rmin)
						sum = sum+5*o.SizeX*VB*sin(D*dpi/Lon-(frame-a)*veloc)
			v.co[2] = v.co[2] - sum*ampl/interv/pow(D, visco)

for f in me.faces: f.smooth = 1

me.setSubDivLevels([1, 3])

if not me.materials: me.addMaterial(wave)

NMesh.PutRaw(me, me.name + '.Fx')

for o in obj: o.makeDisplayList()

this one sort of automatically adds materials
adopted from an older script, I forgot who the original author was


Have you had this working? if so how, Would it work with latest bfBlender?

I made a grid on layer 2 called Wave, then made a sphere called Boat on layer 1, hid layer 2… then alt p…then what?


link it as scene script, onframechanged. says so in its header, innit?

Coo that was quick! :smiley: yea should have put in that I already did that, anything else.


on the second thought - weren’t this the original olikas?

HMMMMMMMmmmmmmm :-?



When I tried Olikas, I get the below for every frame:

Traceback (most recent call last):
  File "olikas2", line 41, in ?
RuntimeError: Depricated:use RenderData.currentFrame

I don’t really know Python, so I don’t know what is going on. :frowning:

Edit: Nevermind, I used tedi’s script. :slight_smile: