In Atoms you can save your simulation on disk using Atoms caches
. It is possible to reuse these caches with the cacheReader behaviour module or with
You can also tweak your caches with the cache reader module in combination with the Layout Tool or
use other behaviour modules.
Exporting a cache
You can export a cache with the "Atoms Cache Exporter".
Before you can export a cache you have to set up a level sequence. Create one from the viewport menu.
Then open the sequence into the sequencer and drag and drop the agent groups you want to export.
For each agent group, add a new track for the "Static Frame" property:
Set two or more key frames making sure their value actually match matche the frame number they are on. Set the interpolation of all key frames to linear or the exported simulation won't look right.
Now add a track for the “Use Static Frame“ property and set it to true. Otherwise, the agent group will not be driven by the sequence.
Open the Atoms Cache Exporter via the Atoms Crowd MenuToolbar Button: Atoms Crowd Exporters > Cache Exporter
There are a few options in the UI:
Level sequence
- Export
Output path
- Cache
Start Frame:
The simulation will start exporting only from this frame in the sequencer. The "Set Start Cache Frame" button will take the start frame of the sequencer range and set on the "Cache Start Frame" field Start Sim Frame: The simulation won't start until this frame in the sequencer. The "Set Start Sim Frame" button will take the start frame of the sequencer range and set on the "Start Sim Frame" field
Once all the fields are set you can click export.
Cache Exporter
The cache exporter will export four files per frame:
- header: basic info such as number of agents at the current frame, number of created agents and number of deleted agents
- frame: agent data such as agent type, position, velocity, bbox and variation
- meta: agents metadata
- pose: agent skeleton data
cache start frame
End Frame: cache end frame
Select the sequence you just created from the Level Sequence property widget.
This will fill the widget above with all the agent groups controlled by the level sequence.
Now select the agent groups you want to export in a cache and press the right arrow icon.
This creates a tree, where the tom item is the name of the cache you are going to export. And the children are the agent groups this cache will contain.
Right-click on the cache name to rename it or delete it. You can also use the small bin bottom to remove agent groups from a cache or the cache from the list.
If you want to add an agent group from an existing cache, select the cache from the right widget, the agent group format the left widget and pres the little right arrow button.
You can export multiple caches at the same time. Just add them to the list.
Set now a valid output path where the exporter is going to write caches. Se the start frame and end frame and press the export button.
Importing a cache
To import a cache from the disk, just drag and drop the file with no padding (i.e. mycache.atoms) inside the content browser.
When importing a cache, Atoms will search for existing Agent Type assets. You can
choose to use the existing agent types or import new ones using the agent type from the cache.
It now generates an atoms cache asset. This asset doesn’t contain agent data but only a reference to the file on disk.