PDA

View Full Version : Particle/object emitter and bullet dynamics



Mr. Wilde
04-12-2015, 06:28 AM
I'm trying to find some information. Basically, I want to fill a container (let's say a bowl) with a virtually unlimited number of objects (let's say M&Ms).

- I want to generate objects (clones or instances) like a particle emitter generates particles.
- I want to change attributes of the clones/instances (e.g. the color of the M&Ms)
- I want the generated objects to use bullet dynamics

Right now I'm at the first stage.

I created a test Sphere and turned it into a RigidBody.
I created a Null called "Emitter", added an Emitter in the FX tab of the object properties.
Then I added an Instance Generator in the Instancer tab. In the Instance Generator properties window, I added the test sphere as object, and set the generation type to "Particles".

Now what happens is that it looks as if the instancer was falling at 9.81 m/sē, not the generated objects (see attached video).

127834

prometheus
04-12-2015, 07:47 AM
Dont think you will have good luck with bullet and millions of millions of objects, bullet donīt work on instances, and you could just as well skip instancing in such case..and only use bullet objects, but then bullet wouldnīt be able to handle that huge amount, a few hundreds of simple objects maybe.

why do you create a null and add emitter? make it simpler..just make an emitter and use instances on that. do no move original object from itīs pivot creation...if you do, then the instances will be offset the wrong way.
There are probably other things making you generated objects going wrong, if they have bullet mass/weight...then they will not follow the particles simulation, so you need to set any bullet weight to zero...which in the end makes them a little useless.

I would suggest..give up the idea of millions of millions of interactive objects.
use bullet without particles and let the bullet engine do itīs thing by itself, for more accurate dynamic sim.


if you want to use particle emitters to drive the motion of the objects..you could particle clone replace particles with the bullet objects(not instance)..but it isnīt a reliable method, and you can only have so many objects before it becomes very sluggish to simulate...


https://www.youtube.com/watch?v=PSd5iN3ZWG0


Michael

Mr. Wilde
04-12-2015, 03:08 PM
Thanks for the reply.

The reason why I wanted to use an emitter is that a) I have more control over the generation per frame/per second, and control over the initial position and motion vectors. With Bullet it seems I have to actually model a bucket with a funnel and drop the 1000 clones into it, and then wait a couple of frames before the simulation lets them drop out of the funnel. And if I'm not happy with the way they drop out of it, I have to remodel the damn thing.

Would it be possible to write a Python script that generates clones of the objects at a certain position in space, and with a certain motion vector, and set all necessary Bullet parameters?

MonroePoteet
04-12-2015, 08:44 PM
If you get tired of wrestling with Bullet, you might try "old school" classic FX, as in the sample scene attached. It really depends on how accurate you need the individual instance motion to be. Sadly, my only real successes with Bullet have been blowing stuff up or destroying things, which isn't along my lines of interest. Probably a lack of experience.

The key elements of the sample scene are the nodal gradient based color to change each instance, the HardFX and Collision classic FX (under the Object Properties=>FX tab), using the particle Size and Interaction "Push" mode to separate the particles, and a separate collision object for the bowl to reduce the offset from the collision object vs. the rendered bowl. I went ahead and exposed the individual inputs to the Gradient, so if you want a texture rather than a pure color (I included a single example) you can do so. It's only 1600 instances, so I don't know how well it will scale to the numbers you need.

Please note that you need to Calculate the FX using the Object Properties => FX => Calculate. I tried saving the particle motion, but the forum upload wouldn't allow the "large" ZIP file required.

Best of luck! Hope it helps.

mTp

Chrusion
04-14-2015, 11:46 AM
Monroe,

FYI: Push mode is for particle from one emitter to push other emitters out of the way. Bounce is for inter-particle collisions.

Have you ever gotten particle self-interaction bounce mode to work AFTER particles have collided with a container? It works just fine during emission (set it to 500% or more and the particles basically explode outward from the emitting volume or mesh points), but is ignored after colliding with an object/mesh with PFX Collision (object-advanced). Thus, filling a volume is impossible. It kind of barely works in that there is a tiny bit of collision repulsion, but there is no controls to dampen particle motions to prevent them from jittering and vibrating as they fight amongst themselves for position in the container due to overlap and intersection with each other.

My solution for simulating filling a volume with Instanced objects using PFX was to emit falling particles in the shape of the container's opening (simple cylinder), while moving a collision plane set to Event upward at the desired "fill rate" (vertical spacing between particles). The collision switched the particles to a second group that didn't have gravity, causing them to freeze in place. Of course it totally lacked interactive dynamics, but visually it wasn't all that noticeable.

Sadly, this faux sim won't work for filling a volume using a funnel, because you need the conical piling up and falling down the slopes effect that only a true Discrete Element Method (DEM) system can provide. Unfortunately, Lightwave is SO far behind the DEM 8 ball in this area. Maya N-particles are much further along, but still, a true DEM particle system (like Solid Works has) has been so desperately needed for that last 15 yrs.

evolross
11-18-2015, 12:22 PM
Yeah I'm pretty sure this is currently impossible in LW at the moment... emitted hard-body bullet-enabled objects.

I did something similar in Maya a couple years ago, here's the thread. It took a lot of tweaking back then, but it worked, but it wasn't full polygon-based rigid bodies, more like two or three-point vertex rigid-bodies. There may be an easier way to do this in Maya now. But this is pretty cool, FYI:

http://forums.cgsociety.org/showthread.php?f=86&t=1095414&page=1&pp=15

prometheus
11-18-2015, 12:37 PM
Yeah I'm pretty sure this is currently impossible in LW at the moment... emitted hard-body bullet-enabled objects.

I did something similar in Maya a couple years ago, here's the thread. It took a lot of tweaking back then, but it worked, but it wasn't full polygon-based rigid bodies, more like two or three-point vertex rigid-bodies. There may be an easier way to do this in Maya now. But this is pretty cool, FYI:

http://forums.cgsociety.org/showthread.php?f=86&t=1095414&page=1&pp=15

hard to follow when it is maya based.
you can fx link rigid bodies and kinematic bodies, rigid might be tricky to get to behave correctly when they are linked, by defualt they seem to loose their collision ability.
kinematic works decently though, as I have shown in my clip above, so you can use a particle emitter with fx linked kinematic bodies, to break another bullet bodie with parts, or to push other bullet bodies that are rigid...it wonīt have effect on static object, nor will they collide with themself when kinematic.

could be possible with nodes, and mdd etc..but havenīt researched that.

Marc Segers
12-05-2015, 04:59 PM
Why don't you use the Lightwave plugin - Advanced Placement ?

evolross
12-06-2015, 10:23 PM
That would work. I think the idea of the thread is more about the fact that LW has Bullet Dynamics, particles, instances... so was there a way to do it natively? As it seems like there would be, but there isn't. But yes, Advanced Placement does it... however, I don't think it does it in a repeatable, playable, keyable solution. You have to manually spray as a placement, not as an animation - which isn't useful if you're trying to render an animation of a spray of dynamic objects, etc.

prometheus
12-07-2015, 10:17 AM
That would work. I think the idea of the thread is more about the fact that LW has Bullet Dynamics, particles, instances... so was there a way to do it natively? As it seems like there would be, but there isn't. But yes, Advanced Placement does it... however, I don't think it does it in a repeatable, playable, keyable solution. You have to manually spray as a placement, not as an animation - which isn't useful if you're trying to render an animation of a spray of dynamic objects, etc.

In my opinion...also a bit too expensive for what it does.