Simulation Cache Reader Plugin

This sample shows how to use the Simulation Cache API and Geometry Generation API to load a Golaem cache, and generate the entities geometry.

Result of a Cache Reader node


The sample is installed in GolaemCrowdPluginDir/devkit/samples/glmCrowdSimulationCacheReaderPlugin.

glmCrowdSimulationCacheReader.h & glmCrowdSimulationCacheReader.cpp Maya dependency node which loads a simulation cache file and generate the geometry.
glmCrowdSimulationCacheReaderPlugin.cpp Maya plugin entry points.
glmCrowdSimulationCacheReader.mel Mel commands to execute in the script editor to create the mesh, the dependency node and connect their attibutes.
glmCrowdSimulationCacheReaderPlugin.mll Compiled version of the code as a Maya plugin


In order to compile this plugin, this sample requires the following dependencies:

Maya This sample being a Maya plugin, Maya libraries are required.
glm_crowd.h Single file library needed to load Golaem Simulation Cache files.
glm_crowd_io.h & (or .lib and .dll) Library needed to generate the geometry from the cache.


Once compiled this sample output is a Maya Plugin which declares a dependency node called GlmSimulationCacheReader:


  • MEL commands to create the mesh, the GlmSimulationCacheReader node and connect their attributes: ​

createNode mesh -n GlmSimulationCacheReaderShape1;
createNode GlmSimulationCacheReader -n GlmSimulationCacheReader1;
connectAttr GlmSimulationCacheReader1.outputMesh GlmSimulationCacheReaderShape1.inMesh;


This node defines the following attributes:

Input Frame Number of the frame to load
Crowd Field Name Name of the CrowdField to load
Cache Name Name of the Simulation Cache to load
Cache Directory Directory where the Simulation Cache files have been exported
Character File File path to a Golaem Character File