Hi, I was looking for a way to animate a bunch of objects, wrote this simple script that can help in some cases. It creates a tri for each selected object and parents the object to this 3 new vertices, so you get a cloud of faces that can be animated or deformed with modifiers, also animating or deforming the objects parented to it… like a dupliface thing the inverse way, the mesh is created frome the objects.
Here’s a video showing some test I did and the script and a file.
Just an experiment but it was fun.
Another video test with this script, there are 1800 objects that can be animated with a single wave modifier. The voronoi crack pattern was done in Inkscape with a click, importing into Blender resulted a bit trickier…
u really are a genius. I tried to do something like this before using the fracture addon, following the same idea as you. I tried to parent different objects to the vertices of a place, and have a modifier effect the plane, therefore animating all the parented objects. However, results were not satisfactory, since i couldn’t pull it off, so i gave up on the idea.
You really have achieved something spectacular, especially the voronoi example. This would be useful for ground impacts, or earthquakes. Something similar to the effects in the film, “2012”, which took the animators quite some time to achieve something like this
ok so uh, how on earth did u get the voronoi texture to “crack” the object into all those different pieces? Could you please provide short step-by-step instructions? It would be reaally helpful, thanks.
Hey people thanks for the kind comments. This can easilly be done by hand on a few objects, just parent each to 3 vertices of a mesh and you’re done. The script creates a face and the parenting for a lot of objects.
@blazr_raidr the voronoi pattern was created in inkscape as a bunch of vectors, then when I finally managed to import them to Blender they where just edges so joined them, did some cleanup, marked sharp, filled faces, and break appart the pieces whith edge split modifier.
@meschoyez: yes I thought about that but it exceeds by far my skills I tried Meshlab but messed up the point indexes… will insist on this. All you can play with are shapekeys and the deform modifiers. @kala_ndo: thanks, I like the text one too
update: just tried a slightly different version that creates only edges according to a vertex proximity threshold, so to be able to do simple softbodies simulations… ‘distancia’ is the value under which an edge will be created… don’t know if this is useful but that was never the point have fun
You need to ‘vectorize’ the pattern in inkscape, then I think I used illustrator to create a dxf, can’t remember now. Anyway here is a small ‘tutorial’ on how it can be done with free tools:
draw some shape in inkscape
generate voronoi pattern from extensions menu
convert pattern to vectors from object menu
save the file as svg
use uniconvertor to get a new blender friendly svg
import svg to blender 2.49 -clamp height to get a flat mesh- and save blend
open or append file in blender 2.5x
each spline is a closed one -that’s bad- so run the little script to convert to edges
in edit mode remove doubles -lot of points-
mark everything as sharp edges so we can split later
fill the mesh -alt + F-
do some cleanup -the fill thing works from up to down and there will be artifacts-
add an edge split modifier in sharp edges mode
apply the modifier
go edit mode again and select all faces
press P to separate by loose parts
go object mode and select all parts
set origin to geometry
you are done!
the script to open splines and convert to mesh:
import bpy
obj = bpy.context.object
if obj.type == 'CURVE':
for z in obj.data.splines:
z.use_cyclic_u = False
bpy.ops.object.convert(target='MESH', keep_original=False)
@liero: that’s really useful !!! thank you very much
ehm, I just . . . don’t know if its my or script’s problem.
If I select more than one object, script creates triangles under all selected objects, but “padre” object is not parented to anything.
(Script works if I select only one object. Tested with blender r34764.)
Unless I’m misunderstanding what you’re saying… what you’re describing is exactly how the script is supposed to work. Now you apply modifiers to the padre object (such as the Wave modifier) and you’ll see all the objects responding to the single modifier (as they have been parented to “padre” via tri-vertex parenting).
EDIT: One thing to watch out for with this script is giving each object its own origin. So you could make a plane, then use a couple arrays to make a field of planes, say 50 x 50 planes. You apply the modifier, then go into edit mode separate by loose parts, which would give you 2,500 planes but each plane would share the same origin. The “padre triangles” are matched with each object’s origin, so before running the script you’ll want to select all your objects and press ctrl_alt_shift+c and choose “Origin to Geometry.” I’m betting your confusion was caused by something along these lines…
benu the script gave me some trouble when run twice on the same file, I even remember appending my objects into a new doc. Didn’t find the reason at the time, but that could easily be vklidu problem…
If you want to play with text there is a little script to separate the letters and set their origins. You can find both as a part of the collaborative multitools addon in blenderheads scripting forum.
As an example add a text object, or just paste some text in a text editor and press Alt+M.
Convert to mesh with Alt+C and add a solidify modifier to the mesh.
Then run this script to get each letter as a single object, with the corrected origins.
import bpy
lista = dict(bpy.data.objects)
for objeto in bpy.context.selected_objects:
if objeto.type == 'MESH':
bpy.context.scene.objects.active = objeto
bpy.ops.object.editmode_toggle()
bpy.ops.mesh.separate(type='LOOSE')
bpy.ops.object.editmode_toggle()
else: objeto.select = False
for objeto in bpy.context.scene.objects:
if objeto.name not in lista.keys():
bpy.context.scene.objects.active = objeto
objeto.select = True
bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')
bpy.ops.object.select_all(action='DESELECT')
Now you can run the parenting script… of course this will work with any mesh other than a converted text, separating pieces and setting the origin.
Just another thing to note, in the planes example you gave I would simply use duplifaces, this script only makes sense if animating differents objects.
@benu: I have to apologize to you I wrote it wrong - objects are not parented to the “padre”
(origins are on a right place), but as I wrote in a new file it works briliant
@liero: first of all it works for me in a new file
Sounds like you wrote, but not sure. Just some feedback:
today I opened your letter file - deleted padre and run the script agian - works
deleted all objects created few new, runed script - it doesnt
unlink script, save, close, open file, open script, place objects - it doesnt
open new file, insert objects, open script, run - it works
I can run succesfuly script severeal times - it works
So the only one problem I had was your leter file to run it again.
About the script (separate letters and set origins) I will test it, but for me looks easier to select all vertices of letters in edit mode and separate by loos parts, than select all letters and set origins to geometry, instead of collecting scripts. I will test it if I miss some feature. Thanks for answer (Also thanks for Alt+M I didn’t know that)