In Atoms you can save your simulation on disk using the Atoms cache, then it is possible to reuse these caches using with the "cacheReader" behaviour module. The Atoms Cache is lightwave lightweight and fast. Compared to live simulation it It can increase the performance 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
There also few other options:
- Multithread: to be used for high number of agents
- Compress: compress each cache file
- Random Access Compress: compress each agent in the file. Best if you are planning to read randomly the agents keeping the benefit of compression; for instance, if you will time offset agents singularly later on.
Importing a cache
You can import a cache in a scene using the cacheReader behavuour 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 agentType agent types that are missing from your scene.
- You can move, rotate the agent groups to place it where you want and 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 cacehReader cacheReader behaviour module
- in In the cache reader height field attribute of the cache reader module select the new hegith height field
- Rewind the scene and press play
Move agents
- Create an agent group and import your cache using the cacehReader behaviour 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
- Press Q to switch to the seleciton selection mode or press or RMB on the viewport and choose Select mode
- Select the agents you want move
- Press W to switch to the move mode or press or RMB on the viewport and choose Move mode
- Use the manupulator manipulator to move the agents where you want, in maya Maya 2016 the manipulator doesn't work so just press the LMB on the location where you want move the agents
- Rewind the scene and press play
Rotate agents
- Create an agent group and import your cache using the cacehReader behaviour cacheReader behaviour module
- To retate 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 seleciton selection mode or press or RMB on the viewport and choose Select mode
- Select the agents you want rotate
- Press E to switch to the rotate mode or press or RMB on the viewport and choose Rotate mode
- Press the LMB and move the mouse on the left or on the right to rotate the agents
- Rewind the scene and press play
Delete agents
- Create an agent group and import your cache using the cacehReader behaviour 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 seleciton selection mode or press or RMB on the viewport and choose Select mode
- Select the agents you want delete
- And from the ui press the "Delete Selected Agents" button or RMB and "Delete agents" from the menu
- Rewind the scene 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 cacehReader behaviour 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 changs changes automatically)
- Set a value of 0.5 in the value field and then press "Set Value" button
- Rewind the scene and press play
Offsetframe
You can offset the cache frame for each agent, so an agent can start playing the at frame 10 instead start from the of frame 0.
- Create an agent group and import your cache using the cacehReader behaviour 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 10 in the value field and then press "Set Value" button
- Rewind the scene and press play
Duplicate agents
You can clone agents inside a cache
- Create an agent group and import your cache using the cacehReader behaviour 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 seleciton selection mode or press or RMB on the viewport and choose Select mode
- Select the agents you want duplicate
- Press the button "Duplicate selected agents" or press RMB and choose "Duplicate agents"
- Atoms duplicates the selected agents and moves the new agents a little bitwith an offset
- Press W to switch to the move mode or press or RMB on the viewport and choose Move mode and move the new agents where you want
- Rewind the scene and press play
Resim agents
The cache reader module giv gives you the possibility to risimulate some agentssimulate again any agent, so oyu you can apply modules that change the atoms direction etc...direction modules and so on.
- Create an agent group and import your cache using the cacehReader behaviour 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 seleciton selection mode or press or RMB on the viewport and choose Select mode
- Select the some agents you want duplicate
- 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 behaviour module atoms Atoms stores some frames of your cache in memory while playing the simulation to improve the performanceperformances. You can use the Cache manager UI widget to load in advance caches and also increase increase the max memory amount reserved by the cache manager. Please look at the cache manager section for more information.