I wrote a Python script in Blender which creates a blocky version of an object with an ocean modifier, so you need to have this object added and animated by yourself.
It should work like this:
An ocean mesh is created by using the original ocean object's mesh, applying all modifiers.
Another mesh is created, all of the polygons facing to the top may be moved.
For each frame from start to end:
A shape key is added to the mesh.
The shape key data is being filled with rounded positions from the ocean.
Keyframes are inserted to make the shape key only influence the mesh at the current frame.
Use the system console to see at which frame it is working at the moment.
But every time I run the script, Blender crashes at a different frame.
The last message (right before the windows close) is this:
Here's my script: BlockyOcean.py
for o in bpy.data.objects
will loop thru all the objects in the file (oftenscene.objects
is a better option) ... but then you are adding to that collection as you go, removing meshes ... it's a little hard to follow.... Questions like these are difficult to answer because you've put a lot of time an effort into writing the script, to which I'd do it this way instead may not be appreciated. $\endgroup$