In this example, several objects are driven by a Dyverso "Rigid" simulation, and controlled by RealFlow's "Particle Skinner" daemon. The workflow, introduced here, is exactly the same for "Elastic" particles:
- Thousands of "Rigid" or "Elastic" objects can be simulated within a single Dyverso domain – this is more efficient than using different domains for each object.
- To identify, which objects belongs to a certain domain, the emitter Id channel is used.
Start with a new RealFlow project and add the following nodes:
- 1 x "Gravity" daemon
- 1 x "Cube" object (= ground object)
- 3 objects of your choice, e.g. a sphere, a cube, and a torus, or several imported custom objects.
The "Cube01" node will be used a ground object and its horizontal dimensions should be around 8 m x 8 m, its thickness should be roughly 0.5 m.
We recommend using high-res versions of the sphere and torus. You can create them inside your 3D program and import them to RealFlow. Alternatively, press F10 to open a "Batch Script" editor and copy/paste the following two lines:
From the "Batch Script" editor's menu choose Script > Run. Scale the objects, but make sure that they do not intersect, otherwise you will see distortions. Then, place the bodies randomly above the cube/ground node.
Now, select the three objects (cube, sphere, torus) and click on Dyverso shelf > Rigid.
RealFlow creates a Dyverso domain and a "Particle Skinner" daemon; the daemon is attached to the domain. When you take a look at the "Node Params" panel you will see that both nodes have the objects, selected previously, applied.
Select DY_Domain01 > Node Params > Domain > Resolution. This value should not be too low, because an insufficient number of particles might lead to collision problems. Values between 10 and 15 are enough here, but you can increase or decrease this value whenever you think it is necessary.
You might have noticed that the scene does not have an emitter included, and this is due to the domain's "Objects" option:
- "Rigid" and "Elastic" particle types only work in conjunction with at least one object.
- When an object is attached it will be filled with particles.
- The particles create a grid structure with the shape of the object.
- The "Particle Skinner" daemon, on the other hand, will transfer the particles' motion and deformation to the object.
Particle Skinner Adjustments
The daemon's setup is very simple and all you have to do is to attach the 3 rigid bodies to "Skin Objects", and choose "DY_Domain01" as the particle source. The remaining parameters can be left untouched:
Now, press "Simulate". Although the objects do not have any body dynamics properties, they are affected by gravity and accelerated. After a few frames the objects hit the ground node, and bounce up and down until they come to rest:
- If you observe collision problems open RealFlow's "Simulation Options" and set Dyverso "Rigid" solver's "MIN substeps" and "MAX substeps" to 5 each.
- Another source for collision issues might be an object's "Cell size" value. Decrease it if necessary under Node Params > Volume> Cell size
- With elastic bodies it is often necessary to use much higher substeps, e.g. 20/20 or even 40/40 – this depends on the complexity of the objects.
- You should also activate the ground cube's "Continuous collision detection" option under its "Node Params" panel.
- With imported objects from SD or Alembic files, activate Node Params > Node > File <-> Curve!
Without the "Particle Skinner" daemon, the objects remain motionless, and only the particles will be moving instead. Play with different domain settings until you get the desired result.