Hi guys, I’ve been trying to replicate the voxelization effect I had seen many times, so finally came up with this simple script. The idea is to increases a mesh resolution -at least where needed- and then snap all its vertices to a spatial grid. This may not be the smartest approach but I got pretty decent results. Then the script removes everything but a clean vertex cloud, and dupliverts a small cube on it.
The people at blenderheads.org thought in animating this, that’s why there is a second script that also supports animation through enabling and disabling object visibility. A pre animated object is baked on each frame -it can be a mesh with modifiers or even text or curves- and the resulting mesh is processed. A material and a group are created for each object.
Suggestions to improve are welcome.
Give it a try and feel free to add your own creations here…
change the prefix name in the script before each pass to keep things clean
‘size’ setting is the grid size, ‘smooth’ is smoothing factor when subdividing
you can animate the static version, maybe with modifiers on the duplivert or the cube/voxel
all voxels of the same animation shares their mesh data, modify the visible one in edit mode
‘hide’ setting: if you enable dupliverts visibility you will see the verts as a trail which adds noise to the viewport, but allows you to move / rotate / scale the entire sequence from the groups mode of outliner…
can take a while on animations, check the progress update in console
wow! this will sure be useful for mograph. As Dhia said, the next step would be to have a way to automatically give the cubes a color. Maybe with vertex color interpolation or by texture.
That’s really awesome! Great work and please keep on working on your script. It’d be great to have this as an addon or a modifier with parameters.
Did you do all the mathstuff yourself? If yes, well done!
Hi, there’s not really much math in here, it was more a brute force thing but it works pretty fast.
What I also liked in this little project is the visibility animation system, I enjoy those icons flashing in the outliner when scrubbing.
The materials support is something I will try some of this days, but I’m afraid it will flicker a bit. The current implementation is based on Blender’s dupliverts, so there is just one object -the voxel cube- replicated hundreds of times. This is very efficient but does not allows to use more than one object or material at a time. What you can do is split / separate the mesh -or maybe use the mask modifier- before processing, so you’ll end up with two or more objects.
@benu glad you liked it, post some pic if you have :yes: @Dhia Eldeen that was easily done in inkscape, more info in the thread
One big difference is the ability to add it to animations. Really incredible stuff; I need to post an example… give me a week to catch up on another project first.
Really nice - I’m going to have to download this one. But you should make it inherit the Material / Texture of the original mesh, if it doesn’t do that already. That would make it perfect.
@MaAaXx the script seems to work ‘ok’ here, see it is not an addon, you need to select an object and run it from a text editor window. @Oyster didn’t know that one… but this is for 2.5x, that’s a difference, and it supports animation. On the other side the method I used to create the voxels is deceptively simple, and works from the skin and not from the volume, affecting the shape when the cubes are too big. I think it can also work with splines, maybe with a stick figure @benu looking forward to see some pic or even better some animation test!
did some other version that plays nice with materials and allows to animate resolution, will upload later…
look in console… sure i understand what is in the console. I used a cube. I got a second cube a new cube every time I run script. Just do not know what to do now.
Hi kazinger! I do think this is simple stuff specially the static one: you’ll get a point cloud from your object named dup, with a cube as a child. The points will be already snapped to a 3d grid and dupliverts enabled so the cube can be replicated…
Please try this: on a clean file delete the cube and add a Suzanne, scale it up a bit and in a text editor window open or paste the first script. With the monkey selected run the script (Alt+P) and you are done… you can now search for the cube inside the dup object, rescale or bevel it or add a material.
the size setting defines the cube size, the gap can be adjusted later, and smooth should be 0 for hard shapes as a cube or 1 for organic shapes as the monkey… tell me if you don’t get anything, the animated version will do the same for you on every frame, animating also the visibility…
Looking at your pic I can see you’ve been playing with the Suicidator City Generator, it is a really great script but will run only on 2.49
Some alternatives to the pixelated script:
with small resolutions -up to 50 cubes- you can just try the particles in grid mode and a cube as the rendered object, you’ll get two modes to play with, surface and volume.
if you take the time to generate a 3d grid -a vertex and some array modifiers- you can even use a modifiers stack, with a subdivide and a shrinkwrap in nearest vertex mode to create the dupliverts mesh.
Wow Thanks. I do not know why the city generator showed up there. I was using it in 2.49. I got it/ 3d pix to work in one of my builds ( It very well could have been operator error ). Its the simple that confuses me. Ill make a simple shape animation now.
Thanks