In Atoms you can save your simulation on disk using the Atoms cache, then it is possible to reuse these caches with the "cacheReader" behaviour module. The Atoms Cache is lightweight and fast. It can increase the performances of your scene dramatically compared to using live simulation.
With the cache reader and the agents layout tool you can edit and tweak your cache.
Exporting a cache
You can open the cache exporter GUI using the shelf button or via the Atoms Menu: Atoms > Export > Cache Exporter
- Select the agent groups you have created from the list, then choose a path where your cache will be saved.
- Finally select your start and end frame.
- Click on the "Export" button.
Importing a cache
You can import a cache in a scene using the cacheReader behaviour module
- Create and agent group.
- Add a cacheReader behaviour module.
- in the cachePath attribute of the cache reader module pick the cache file (the file named youCacheName.atoms)
- Rewind the scene and atoms will load the cache. It also automatically load all the agent types that are missing from your scene.
- You can create multiple agent group to load different caches or the same cache multiple times. You can also move then around and rotate them.
Editing a cache
When a cache is loaded in your scene you can still edit it to change your layout or simulation.
Apply a new height field
Even if you exported the cache from some agent groups on a height field you can apply a new height field to your cache
- Create a new height field
- Create an agent group and import your cache using the cacheReader behaviour module
- In the height field attribute of the cache reader module set the new height field name you created
- Rewind the scene or press UpdateSim from the shelf and press play
Move agents
- Create an agent group and import your cache using the cacheReader behaviour module
- To move agents you can use the transitionOffset attribute or you can use the Agents Layout Tool
- Select the agent group and activate the agents layout tool from the Atoms menu: Atoms → Tools → Agents Layout Tool or just press enter
- Press Q to switch to the selection mode or press from the agent layout tool ui (press P to show the ui)
- Select the agents you want move
- Press A to switch to the move mode or press from the ui
- Use the manipulator to move the agents where you want
- Rewind the scene or press UpdateSim from the shelf and press play
Rotate agents
- Create an agent group and import your cache using the cacheReader behaviour module
- To rotate agents you can use the rotationOffset attribute or you can use the Agents Layout Tool
- Select the agent group and activate the agents layout tool from the Atoms menu: Atoms → Tools → Agents Layout Tool
- Press Q to switch to the selection mode or press from the agent layout tool ui (press P to show the ui)de
- Select the agents you want rotate
- Press Z to switch to the rotate mode or press from the ui
- Press the LMB and move the mouse on the left or on the right to rotate the agents or press SHIFT+LMB to rotate around the group pivot
- Rewind the scene or press UpdateSim from the shelf and press play
Delete agents
- Create an agent group and import your cache using the cacheReader behaviour module
- To delete agents you can use the filterAgent attribute (set value of 1 to remove an agent) or you can use the Agents Layout Tool
- Select the agent group and activate the agents layout tool from the Atoms menu: Atoms → Tools → Agents Layout Tool
- Press Q to switch to the selection mode or press from the ui
- Select the agents you want delete
- And from the ui press the "Delete Selected Agents" button
- Rewind the scene or press UpdateSim from the shelf and press play
Change agents speed
You can also change the agent speed changing the frameRate attribute. This attribute is a multiplier on the input time.
- Create an agent group and import your cache using the cacheReader behaviour module
- To change the speed of some agents open the override agent dialog next to frameRate attribute
- Select the agents you want modify form the list or use the Agents Layout Tool to select the agents (the selection inside the override dialog changes automatically)
- Set a value of 0.5 in the value field and then press "Set Value" button
- Rewind the scene or press UpdateSim from the shelf and press play
Offset frame
You can offset the cache frame for each agent, so an agent can start playing at frame 10 instead of frame 0.
- Create an agent group and import your cache using the cacheReader behaviour module
- To offset the start frame of some agents open the override agent dialog next to frameOffset attribute
- Select the agents you want modify form the list or use the Agents Layout Tool to select the agents(the selection inside the override dialog changes automatically)
- Set a value of 15 in the value field and then press "Set Value" button
- Rewind the scene or press UpdateSim from the shelf and press play
Duplicate agents
You can clone agents inside a cache
- Create an agent group and import your cache using the cacheReader behaviour module
- Select the agent group and activate the agents layout tool from the Atoms menu: Atoms → Tools → Agents Layout Tool
- Press Q to switch to the selection mode or press from the ui
- Select the agents you want duplicate
- Press the "Duplicate selected agents" button
- Atoms duplicates the selected agents with an offset
- Press A to switch to move mode or press and move the new agents where you want
- Rewind the scene or press UpdateSim from the shelf and press play
Resim agents
The cache reader module gives you the possibility to simulate again any agent, so you can apply direction modules and so on.
- Create an agent group and import your cache using the cacheReader behaviour module
- Select the agent group and activate the agents layout tool from the Atoms menu: Atoms → Tools → Agents Layout Tool
- Press Q to switch to the selection mode or press or RMB on the viewport and choose Select mode
- Select some agents
- Open the override agent dialog next to directionFromCache attribute
- Set a value of 0
- Create a curve near the selected agents
- Add a follow curve module
- Attach the curve to the follow curve module
- Rewind the scene and press play, now the selected agents will follow the curve
Using the Cache manager
When you use the cache reader module Atoms stores some frames of your cache in memory while playing the simulation to improve performances. You can use the Cache manager UI to load in advance caches and increase the max memory amount reserved by the cache manager. Please look at the cache manager section for more information.