Simulation Cache Proxy

The Simulation Cache Proxy node allows the scrubbing and previsualization of a previously exported Simulation Cache and can display the layer deformations applied from the Simulation Cache Layout. It should allow to display / edit comfortably a few thousands of entities. However for heavy scenes, import and display could be more demanding and make framerate drop under a few fps.
 

Previsualization of an exported Simulation Cache using the Simulation Cache Proxy.
 
To be able to use the Simulation Cache Layout node, a Simulation Cache must have been exported first.

Creation

A Simulation Cache Proxy node is automatically created when a simulation is exported using the Simulation Exporter Tool.

  • Golaem Shelf: 
  • Golaem Render Menu: Simulation Cache Proxy
  • Tool: Simulation Cache Library
  • MEL command: glmCrowdSimulationCacheProxyCmd;
  • Toggle between Simulation and Cached Replay: (for Simulation) / (for Cached Replay).

Simulation vs Cached Replay Mode

As soon as a Simulation Cache Proxy node has been created in a scene, Golaem can be toggled between two modes:

  • Simulation Mode: this is the default mode when no Simulation Cache Proxy node exists in the scene. It allows to compute the crowd simulation, evaluate behaviors and triggers and export the results as a Simulation Cache.
  • Cache Replay Mode: this is the mode which is enabled when a Simulation Cache Proxy node is created in the scene. It allows to preview a previously exported Simulation Cache and can display the layer deformations applied from the Simulation Cache Layout.

There're several ways to check in which mode Golaem is: looking at the Shelf icon and at the Maya timeline:


Difference between Simulation Mode (left) and Cache Replay Mode (right)

Configuration

If the Simulation Cache Proxy is created in a scene where a crowd simulation has been exported or from the Simulation Cache Library, most of the following parameters are automatically filled but are editable if needed.

By default, most of the Display and Terrain Attributes are connected to the Simulation Cache Proxy Manager Attributes but are editable per node if needed.

Time Attributes

By default, those attributes are connected to the Simulation Cache Proxy Manager attributes.

Frame Current frame to display

Input Cache Attributes

CrowdField Names Name of the Crowd Fields to import. Separate the names with ;
Cache Name Name of the Simulation Cache to import
Cache File Dir Directory from where the Simulation Cache files will be imported
Character Files File path to the Golaem Character File (.gcha)
Start Frame First frame to import
End Frame Last frame to import
Draw Entity percent Only draw a given percent of entities to save display time.

Input Layout Attributes

Enable Layout If checked, the result of the deformation layers contained in the specified Layout file will be displayed in the viewport for this node
Layout Name Name of the Layout file (.gscl) to apply to this node. The applied Layout file can be changed using the Simulation Cache Layout Tool
Cache File Dir Directory from where the Layout file is read. The applied Layout file can be changed using the Simulation Cache Layout Tool

Terrain Attributes

By default, those attributes are connected to the Simulation Cache Proxy Manager attributes.

Enable Terrain Adaptation If checked, when edited using the Simulation Cache Layout Tool, the Entities will be adapted on the Terrain
Orient Pelvis On Terrain Normal If checked the Entities will also be oriented along the normal of the Terrain
Source Terrain File path to the terrain geometry which has been used to create the Simulation Cache Files. The Terrain geometry file is automatically exported the first time a simulation is exported in a new directory. This file can be updated using the Export Source Terrain below.
Destination Terrain File path to the terrain geometry on which the Entities will be adapted when using the Simulation Cache Layout Tool. If none is specified, Entities will be adapted to the Source Terrain file. This file can be updated using the Export Destination Terrain below.
Export Source Terrain Exports the Maya geometry meshes used in the simulation as a Source Terrain file. As it exports the meshes connected to the Terrain Locator used by the Crowd Fields on this node, it only works if the simulation is in the same scene. The Terrain is automatically exported in the same directory than the Simulation Cache Files of the node
Export Destination Terrain Exports the currently selected Maya geometry meshes as a Destination Terrain file. The new Terrain File will be used to adapt the edited Entities on. The Terrain is automatically exported in the same directory than the Simulation Cache Files of the node.
Refresh Terrain Flush the Terrain cache used for adaptation and reload it
Draw Terrain If checked the Destination Terrain will be displayed in the viewport

Display Attributes

By default, those attributes are connected to the Simulation Cache Proxy Manager attributes.

See here.

Output Cache / Layout Attributes

These attributes are used when a the deformations of a Simulation Cache Layout are baked down to a new Simulation Cache:

Start Frame First frame to export
End Frame Last frame to export
Cache Name Name of the new Simulation Cache files
Cache File Dir Directory where the new Simulation Cache files will be exported (must be different than the one specified in the Input Cache Attributes)
Layout Name Name of the new Simulation Cache Layout file
Layout Dir Directory where the new Simulation Cache Layout file will be exported

Plug Output Attributes

Notice that the Plug Output Attributes does not work in Maya batch. You can use the glmSimulationCacheTool as an more performant and batch enabled alternative.

Enable Plug Output If checked, the orientations, positions and scales contained in the loaded Simulation Cache will also be written in the compound plug attribute entityOut
Entity Ids List of Entity Ids to write in the compound plug attribute entityOut. Use the  icon to fetch the Ids of the Entities currently selected in the Simulation Cache Proxy Node
In Maya Skeletons List of Maya skeletons (root bones) which will be constrained to each specified Entity. First Maya skeleton will be constrained to the first specified Entity...
Bone Names Name of the bones which will be detached or attached. Separate the Names with , or use * for all. Use the  button to open a window with the name of all the available Bones for the Character Files loaded in the scene.
In Maya Objects List of Maya Objects which will be constrained to each specified bone of each specified Entity. First Maya object will be constrained to the first specified bone of the first specified Entity...
Refresh Objects Use this button to refresh the connection between Maya objects and skeletons and the Plug Output Attributes. It must be called eveytime a change is made in the above attributes.

This can be used to compute fur, cloth, FX interaction or render characters without using procedural rendering (tutorial). Each bone of the destination Maya Skeleton is recursively connected the same way to the Simulation Cache Proxy node and it provides the following result:


Left: Simulation Cache Proxy Crowd Entity - Right: Driven Maya Skeleton and skinned Geometry

Advanced Attributes

Dirmap Rules Current dirmap rules to relocate Geometry file (.fbx) absolute paths stored in the Character Files (.gcha) at render time.