Caching Explosia FX

This page covers how to save an Explosia FX simulation to an OpenVDB format file which can then be imported into another application (which must, of course, be able to import OpenVDB volumes).

On this page we'll create a simple simulation, cache it to OpenVDB format, then import it into a new scene.

1. Create the new scene

This is a very simple scene with these objects.

Note that the Explosia FX object has been renamed to 'efx_cache_test' (you don't have to do this, this is just to show an important point in this demonstration):

You can add the Wind object from the Explosia FX 'Forces' tab. The wind strength is set to 3 units, and turbulence is also enabled, with a strength of 2 units. This produces the following result:

 

2. Create a folder for the cache

Create this anywhere you like and call it anything you like. We created a folder called 'efx_cache'.

3. Add a Cache object to the scene

In the Cache object, make the following changes:

The only changes are to set the EFX Format to OpenVDB and to set the Folder to the new folder we just created.

4. Cache the scene

When you build the cache, a folder with the same name as the Explosia FX object (in this case, 'efx_cache_test') will be created inside the 'efx_cache' folder. That new folder will contain all the cached files, one per frame, named efx_cache_test_000001.vdb, efx_cache_test_000002.vdb, and so on. This is all standard behaviour of the Cache object - please refer to that object for more details.

You can now import these files into any software which can load OpenVDB volumes.

5. Load the OpenVDB file(s) back into Cinema 4D

Now that we have some OpenVDB files to work with, we can reload them into Cinema.

Create a new Explosia FX solver

In a new scene, create an Explosia FX solver object. Now rename this to match the name of the cached files - so in this case, it must be renamed 'efx_cache_test'. If you don't do to this, the Cache object won't be able to load the cached files into the solver.

Create a new Cache object

Add a Cache object to the scene. Make exactly the same changes as the Cache object used to create the cache - that is, set the format to OpenVDB and the Folder to 'efx_cache'. The Cache object will load the cache files from the sub-folder named 'efx_cache_test' and assign the data to the Explosia FX object named 'efx_cache_test'. You see now why it is crucial that the Explosia FX object name matches the name of the cache files to be loaded!

Note that the scene no longer has a source object or an Explosia FX Wind object in it, but you can now play the scene, which will be significantly faster than the uncached scene, but with identical results.