4
$\begingroup$

I have tried everything to fill an invisible container with particles but the particles just seems to sinks to the bottom and they don't fill the container. I am trying to create something like in the video below how balls take the shape and fill up the space i want to create something like this. Please help.

Edit : have also tried the molecular script but that doesn't seem to work as well.

https://www.youtube.com/watch?v=QgUipRRin0k&t=16s

$\endgroup$
  • $\begingroup$ Try uploading the .blend file here: blend-exchange.giantcowfilms.com $\endgroup$ – Georges Mar 28 '17 at 16:10
  • 1
    $\begingroup$ Done added. see how the particles settle at the bottom and don't take the shape of the cube as shown in the video. also if i increase the particle count they just intersect and keep bouncing instead of taking the shape. $\endgroup$ – bluesky Mar 28 '17 at 16:27
  • $\begingroup$ There are lots of tutorials already on youtube for this. I have pasted a link below. Seems like you're missing setting the containeir rigid body properties correctly? youtube.com/watch?v=CS-7tHZjrOQ $\endgroup$ – CoderX Apr 29 '17 at 9:44
6
$\begingroup$

You can use rigid body physics to simulate the particles filling a containing mesh. This is a different approach from using the particle system.

enter image description here


1) Create the container geometry. Make sure there is an opening for the particles to enter.

2) Create the particles to fill the container. The particles can be created by add a single sphere to the scene. Then using 3 array modifiers to generate the collection of spheres. Apply the modifiers. (see explaination) Then, in edit mode partitioning the mesh using P> Selection to separate the selection into a new object (see explanation ) When done, you should have the container and particles which will fill it.

enter image description here

3) Add a solid body physics to the container. Duplicate the settings shown here. The default settings are modified do the container will hold something, but not move during the simulation. Also, the mesh is used to contain the particles.

enter image description here

4) Apply solid body physics to a single sphere. The default settings are modified to allow the spheres to move and to ensure that the sphere stop moving relatively quickly once in the container.

enter image description here

5) Copy the physics settings to all of the spheres. Select all of the spheres, deselect the sphere with physics, reselect it last so it is the active object. Then use the physics toolbar to apply the physics to all selected objects. (see explanation

enter image description here

6) Set the final timestep for the simulation to 100.

enter image description here

7) The default physics settings may not get the desired results. Modify the physics setting for higher accuracy. Depending on the number of particles, it might be necessary to tradeoff accuracy for simulation time by decreasing the number of iterations and steps. Once done, press 'Bake All Dynamics'. It may take several minutes to complete the simulation. The progress bar in the info bar will show the progress in the simulation. Once done, the simulation that was used in the animation will be completed.

enter image description here

info bar

8) If the simulation is settled down on the last frame, this is a reasonable approximation of the filling in the container.

enter image description here

An example with an alternative container.

enter image description here

This solution can be used for any shape container. More particles can be used, the simulation times will be higher with more particles.


Blend file -

$\endgroup$
6
$\begingroup$

You can achieve this using particle Self Effect to prevent the particles from overlapping by having each particle exert a force on its neighbours whenever it is too close.

Create the particle system and set up as desired with the particles of a particular size. It's a good idea to set some Brownian to allow them to jiggle a bit (allowing them to find the available space) and some Drag and/or Damp to calm them down a bit.

Add a Self Effect Force field with Falloff Power of 2 (ie, distance squared - like a natural force) and with a Maximum setting to limit the distance of the force.

particle settings

You might want to play around with the settings and sizes a bit - I found that Maximum twice the size of the size of the particles was working quite well for my situation. You might also want to increase the Subframes for a better simulation (but it will take longer to calculate).

This can produce the following result :

result - animated

$\endgroup$
-1
$\begingroup$

Change the Physics type in the Particles System to Fluid, you might need to tweak the parameter's to get the desired results.
enter image description here

$\endgroup$
  • $\begingroup$ how can i stop particles from gathering on the sides? $\endgroup$ – bluesky Mar 28 '17 at 19:00
  • $\begingroup$ The shape of the container plays a role in this, try to bevel the edges, and as I said in the answer, tweak the fluid physics parameters $\endgroup$ – Georges Mar 29 '17 at 5:55
-1
$\begingroup$

Make sure you have the emitter set to emit from volume.

enter image description here

$\endgroup$
  • $\begingroup$ i even tired with volume it doesnt work $\endgroup$ – bluesky Mar 28 '17 at 18:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.