GSoC 2012 - Bullet Integration

Of course. It’s in already. Click here.

Thank you!
I’m working on new video demos. :slight_smile:

Ever.

Hey, I just tried the build, and it works great! I don’t know if this is in the scope of this project, but what about making rigid bodies work with other simulation types. Probably not fluid or smoke, but what about cloth or soft body?

Also, I don’t understand the point of a “passive” rigid body- isn’t that the point of the ‘collision’ type? Yet fluid and smoke have their own collision, so perhaps not. It just seems all very unorganized.

Another disappointing this is that if I move a passive rigid body, it resets the simulation. No more playing ping pong in the viewport;)

Other than that, it really is looking awesome! Keep up the good work, I hated having to go into the game engine trying to get rigid bodies, it made no sense.

I mentioned earlier in this thread that I want to make a video showing how it works, just didn’t have the time yet.

Well, when I followed this project two years ago when Aligorith started working on it I wasn’t much of a programmer myself. It just takes time and dedication, like everything else.
Also I’m really bad at providing builds :stuck_out_tongue: so I’m really happy that others do.

Thanks demohero for the windows build.

Having blender’s simulations work together is a non-trivial undertaking that would probably come close to rewriting them from scratch. What we can do however is having a one way interaction. Rigid body dynamics actually have more in common with the animation system than the other simulations so it should be possible for it to influence the other simulations like the animation system does.
Another thing is that bullet does have soft body simulation support, eventually I’d like to add that as well (it’s out of scope for GSoC though).

In regards to passive objects, you have to understand that bullet has it’s own collision objects and we cannot use blender’s existing collision modifier (at least not easily).
So the difference between active and passive is that passive objects don’t get simulated dynamically and mostly provide a backdrop for active object to collide with.

The resetting of the simulation when moving objects is a side effect of having point cache support. It’s annoying to me as well and I definitely plan to improve the situation, it’s just that dealing with cache invalidation is a little tricky so we have to come up with a better scheme (it’s on my TODO list).

Video time:

A little off the cuff but hopefully understandable.

Looking fantastic. I, personally, would love to see more in-depth stuff if you’re up to it. It seems like a godsend for FX artists. All we need now is some good destruction =)

@Sergof Thanks for the tutorial. Just what I needed :slight_smile:

It seems like a godsend for FX artists

For sure! I cant wait to see what else is up your sleeve:)

sergof, thank you!

Great tut you explained it very well,
i was having the problem with the plane turning into a trampoline
(shooting to cube into the air! LOL, now i know its a scaling problem) sheesh…

and dont be self-conscious about your English accent,
you speak very well. look forward to more tutorials. :slight_smile:

Hello, very nice results so far.

I wanted to ask, if there is a plan to also expose some api in python.
I would be very interested in a sweepmesh function, since I started developing a cam extension for blender, and the most accurate way of estimating tool position against a surface is actually colliding the shape against the result. There is allready a rayintersect function, which works quite well, I so far sample eax vertex of the tool against the resulting object. But it would be great to use bullet, it would be surely faster and would have face-vertex collisions.

thansk for the great work. VN

I’d like to second the Python API question?

It would be cool to be able to call a fracture script or other simulations on collision, etc.

i have been trying to build a jenga puzzle…
but have been having trouble with the beginning it totally screws up,(when press play)
i tried clicking “start deactivated” but it doesn’t seem to work correctly…

it seems pretty cool just think its need some refinements and maybe an “easy button” :slight_smile:
or presets(like wood, concrete, plastic) these presets would change the mass and maybe some of the other things im not sure about, maybe make things more stable. edit* ok i think i figured it out… still think it needs an “easy button” seems like it could be “simplified” somehow.

is it possible to have an mesh and enable bullet dynamics on it. then make particle system that emits particles instancing that objects. and all particles collides using bullet physics.

because the current way collision is just calculated like a hit test on a sphere whatever the mesh looks like, so you get very basic collisions and rotations.

Well this is actually a separate issue.
I completely agree that providing a API to do collision detection would be very useful but it’s not really part of rigid body simulation.
Right now we don’t use bullet’s collision detection interface much, mostly the dynamics interface so there actually isn’t even a C API to do collision detection right now.
Another issue is resource management. In order to use bullet for collision detection objects need to have collision objects (and depending on what you want to do those need to be in a collision world) so you would only be able to use this API on objects that are part of the rigid body simulation since object’s in blender normally don’t have bullet collision objects (or somehow create them when needed).
I’m not sure what a good approach would be here so it needs more thought.

Querying the simulation for information and have some sort of callback system to perform actions on specific events is a request I got several times already.
The problem is that I’m not sure yet how to do this in a nice and flexible way so I’d prefer to first get the basic system functional and stable before starting on it.
Regarding the fracturing stuff, this is actually quite tricky. Right now every rigid body needs to be a separate object. If you want to create objects dynamically you’ll get in trouble really fast (what happens when you reset the simulation, delete the new objects and restore the old ones?).
I have ideas to do dynamic fracturing but it’s not that simple and has to wait until after GSoC.

We would need to store a rigid body per particle and do many other changes to the particle system in order to allow this.
I’m not a fan of doing it this way. A better way would be to have a more generic particle system that doesn’t hard code everything and has a more modular structure. From what I could see the node particle stuff from Lukas aims at providing exactly that. So I’d rather use that than loading even more stuff onto our current system, but this will take more time of course.

I’m glad you’re thinking ahead in the same direction :slight_smile:
Currently i’m working on a number of improvements for particle nodes code, with the goal of having a nice generic “integrator” interface that can be used for connecting particle systems with different optimized simulation systems. My own basic integrator just works with simple point masses (like the newtonian physics mode in current particles). Bullet rigid body dynamics could then be implemented as a different integrator variant.

The particles will need to be sync’ed with the bullet dynamics world in each timestep by the integrator, which can be done nicely optimized i’m sure. Then perform the stepping and write the rigid body data back to particles. Collisions will probably use a kind of callback system, where each collider uses a separate node tree to define what happens to particles on collision. Anything specific to the Bullet physics implementation (like setting dynamic response parameters) can be put into specialized nodes, so everything is nice and modular.

I’ll write a more detailed post about this stuff when the current coding marathon is finished (hopefully end of the week).

That’s pretty much what I had in mind.
I didn’t have time to take a good look at your system yet so having docs to get an idea of how it works would be nice (I don’t mean to rush you though since I’ll be busy with this project for a while:)).

@phonybone @sergof

that would be such an awesome way to do collision and have bullet dynamic particles, and also the most awesome way to make the ‘old’ (forgot the exact name now) but particle system that is birthing particles from collision of another particle system. Reaction particles?

lag doublepost.

Hi, Could someone upload a 32bit windows build of this, I have no ability / knowledge with building from source and I’ve been waiting for this since 2010. LOL, The progress is awesome though. I was wondering if constraints would work with it…

i have downloaded what you have done so far and this is a very very great improvement on blender
nice job :yes:

This is quite brilliant! I definitely look forward to seeing your progress, and then eventually using this in Blender. Just the other day I had to fake something, and was looking into UDK to see if I could learn the physics system in it. I’ll just wait for this great tool to be added to Blender.

Thank you!