# Demolition Script & Tests

(Kai Kostack) #1

hi,

i’m working on a script for simulating believable demolition effects.

i dreamed to have such a software since i saw this from ILM in 1998 for star wars. it took a while to make it work, because i was not familiar with the complicated math needed for this. since i’m just an artist, i had to reinvent the wheel completely new based on my imagination.

but now i’m very enthusiastic about my first results after weeks of thinking. here are some tests. feedback is well appreciated.

completely rigid beam

beam interacting with engine

highres videos

Release edit

latest script only: demolition.py

latest working GUI-version i know of (obsolete): Demolition_with_GUI_1.1.71029_Beta-panzi4.zip

a nice tutorial for the GUI and the GUI-less version can be found here.

a video tutorial is also available: Blender Demolition Video Tutorial #1 - Cube and Sphere.avi (22.8 mb, XviD)

and the manual can be found here: Demolition Manual.rtf

i hope it’s not too hard to manage.
don’t hesitate to show your demolitions here.

(zog34) #2

I would be enthused as well with these as initial results! Nice job! Do you have it so that the object’s energy is drained as it collides? (Thus simulating the slowing of the objects. Though this could be done on the animation end as well.)

It looks like the car just keeps moving. Try animating it so that it slows exponentially (a parabolic curve).

Nice job! Especially the tearing effects!

(Kai Kostack) #3

yes, i kept the iteration depth very low for calculation speed reasons. on the third test it needed around 2 minutes per frame only for the simulation of the physics. less iterations means very high object speed in real life, so this car body is probably as fast as an airplane.

i’ll do some tests with more iterations to see if i’m right.

(Michael_S) #4

Is it really a python script or do you call C-code or external libraries?
And will you release the script when you’re happy with it? I’d really like to try it myself…
Michael

(garuhhh) #5

this may sound dumb… but what’s the demolition script for?
edit: ow… sorry… the animation wasn’t playing when i first saw this thread… now i know what’s it for. thanks! looks great! i’d love to have that

(Rinne) #6

Something I have dreamed off myself for a long time, great work, keep it up

(Kai Kostack) #7

@garuhhh:
the demolition script is for all kind of destructions. you can simulate smaller things like breaking glas, tearing clothes or a piece of paper. but you can also think bigger, for instance airplane crashes, ship crashes, car crashes, starship collisions or explosions. think of asteroids crashing into city skycrapers or whatever. you can do everything you can imagine with this script. :eek:

@Michael_S:
yes, i’ll probably release it sometime it is finished. but at this stage it’s horribly to use for end users. no gui, no docs, nothing. just a lot of code. by the way, only python code. no libs of any kind are needed.

(Michael_S) #8

yes, i’ll probably release it sometime it is finished. but at this stage it’s horribly to use for end users. no gui, no docs, nothing. just a lot of code.

Don’t hurry, i can wait (and the others as well - i hope) …
I know how it is:
Getting something to work for yourself is one thing.
Getting it to work for others too is a completely different thing.
Gui, error checking, code cleanup, documentation, comments, … sometimes it takes longer than writing the initial code…

Greetings from Erlangen
Michael

(forTe) #9

Hey looks pretty nice,

If you don’t mind me asking, how do you animate the mesh? Do you update the meshes and render after each update or is there some other method your using?

(Craig Jones) #10

Very nice work, and I really like the engine wrapping around the beam. Good work, and I hope to see it accessible later!
Craigo

(Kai Kostack) #11

@forTe:
it’s using script links and updates the meshes on every frame change, so it also calculates automatically while rendering. and that’s another dangerous point. although it tries to copy the destruction meshes before the simulation starts, this script can mess up your scene.

(BA4EVR) #12

WoW! Absolutely Amazing! I have wanted something like this for so long, Very Good job Kai!
Sorry to ask, but when do you reckon it will be ready for release?

(Cognis) #13

I love it, and I have nothing but the utmost respect for your will and ability to tackle this enormous challenge. What you have already is eye-popping, and I am already anxious to see what you will add next!!

I have two questions in the matter:
1: Does your script involve objects being torn into multiple pieces? It looks like it, but I cannot see if faces simply go transparent.
2: Next big challenge :D: In a real-world collision, a lot of different parts with a lot of different bending and breaking points get crushed together. Do you know if the script will be able to handle that (now or future)?

I long wanted to see someone truly tackle this really big (and so cool) challenge. My mind is already spinning with what various variables might do, like going from crumbling metal to shattering glass to ripped fabrics, etc. Could be cool if one day you could do a car that had the surface metal crumble (as seen in demo1) over the much harder inner chasis, windshield blowing out and wood in the telephone pole struck splintering. And some textiles ripping, too, I just don’t know how to fit them into this little fantasy of mine

EDIT: Oh, and simulation of volume. Damn this stuff gets my blood running! Go for it, and don’t hesitate if I can help with something (probably not, but never know…)

EDIT2: Just noticed you mentioned that calculation time fir the script was high. If you need it, I have a 2.6GhZ machine standing idle (my Blender-use-only machine), would be honored to take a load off your computer (so that you can use it for scripting this thing :D)

(Big Fan) #14

very impressive so far
keep working
it would be nice if this was done in C eventually and included like fluids

(Cognis) #15

Theoretically, wouldn’t it be possible to have fluids interact with the demolition somehow even without demolition being in C? (“Demolition in C”… sounds like a heavy metal tune :))

(garuhhh) #16

@garuhhh:
the demolition script is for all kind of destructions. you can simulate smaller things like breaking glas, tearing clothes or a piece of paper. but you can also think bigger, for instance airplane crashes, ship crashes, car crashes, starship collisions or explosions. think of asteroids crashing into city skycrapers or whatever. you can do everything you can imagine with this script. :eek:

oh goodie! thanks thanks! i enjoyed that feature of 3ds where an object can be blown into pieces (what’s that called again?), booom… then you see the small pieces flying away, tumbling, then gone. i think, in 3ds, its done using particle emissions (?).

(Ace Dragon) #17

Intergration into the source code of Blender is a must if you can get this script working.

Perhaps you can work with Erwin to add this to bullet physics:)

(ecgilboy) #18

This will be an awesome addition to bullets physics…

(dschnell289) #19

I can’t wait for this to be more complete and included in Blender! (But I guess I have to!!). Didn’t somebody have an explode modifier patch a while ago (like about 2 years ago)? I was sad that it didn’t evolve and get included in the main code. Something like this will really make effects works much more viable with Blender (and therefore used more in the big industry).

(Kai Kostack) #20

wow, thanks for all the nice reactions.

@Cognis:
no, it’s not a material trick. i’m completely changing the mesh topology. so every polyfragment is being calculated as independend mesh.
as for your second question, i’d like to keep is as simple as possible. this project should not lead to become an alternative to pamcrash or lsdyna in the end. speed and simplicity is more important to me than scientific accuracy. not only because i’m an artist and not a physicist. on the other hand, who knows what the future brings? maybe…
and simulation of volume is something even more far away.
thx, for the offer with your computer. i’ll come back to it when i have no resources left over.

@garuhhh & dschnell289:
it’s called meshbomb. but you cannot compare meshbomb to demolition (i like this short form of the name ;)). meshbomb is a very simple particle system without any calculation of forces or stresses in the surface of the mesh, whereas demolition simulating this all.
btw, jahka’s new particle system for blender includes a modifier called explode which is doing the same job as meshbomb in max.

as for the integration into blender or bullet… i’m a c programmer too, but blender is such a huge an intimidating software (needs half an hour to compile), i didn’t dare to write it in c. i think it’s also difficult for people who are familiar with the blender code. 3d programs usually don’t like if a mesh topology is changing over time. the indices of vertices, edges and polygons are shifting around, which would make blender mad. i don’t even know, if my script will work together with vector blur for that reason. i’ll have to test this.

it seems that the heavily deformed car test, is also caused by a limitation of the current simulation. i need to implement resistance to folding and bending to handle this type of unenforced geometry properly. i’ll look into this today.