glmMayaToSimulationCache

The glmMayaToSimulationCache command exports skeleton animations from a Maya scene into a Golaem cache that can be used directly with the Layout.
glmMayaToSimulationCache [-fromRoot string] [-characterFile string] [-startFrame int] [-endFrame int] [-cacheDir string] [-cacheName string] [-crowdField string] [-exportNewCharacter bool double] [-exportTerrainMeshes string] [-autoSwitchProxy bool]

Flags

Long name (short name) Argument types Properties Description
-fromRoot (-ro) string multi-use

List of the root joints to convert into Golaem cache

If none is given, the command will take the currently selected joint nodes instead.

If no skeleton node is selected either, the command will export every joints from the scene.

-characterFile (-gch) string multi-use

Full path of the input gcha character file.

Several character files can be given by using the flag several times with different argument values.

If no character file is given, the command may automatically build them, see the exportNewCharacter flag.

Character files are assigned to the the joints in scene depending on the hierarchy and number of joints in the skeleton. If they differs, they can't be used.

-startFrame (-sF) double  

Frame at which starting to export cache. Will start from the first frame in the Maya timeline if flag is not set.

-endFrame(-eF) double  

Frame at which stopping to export cache. Will stop at the last frame in the Maya timeline if flag is not set.

-cacheDir (-cd)

string

mandatory Directory to export the cache
-cacheName (-cn) string mandatory Name of the exported cache
-crowdField (-cf) string   Name to give to the crowdfield in cache
-exportNewCharacter (-enc) bool double  

bool argument: allow to automatically create .gcha to correspond to the Maya skeleton and geometry (default: true)

double argument: 0 to automatically choose between .gcg or .fbx geometry files, 1 to force .gcg, 2 to force .fbx

-exportTerrainMeshes (-etm) string multi-use Name of the maya meshes which will be exported as a Terrain File.
-autoSwitchProxy (-asp) bool   true to automatically create a proxy that loads the cache into the scene after exporting it. (default: true)
-cacheQuantizationMode(-cqm) int   Quantization mode to use:
  • 0 to not use quantization (default value)
  • 1 to quantize orientations at 50%
  • 2 to quantize orientations at 25%
  • 3 to quantize positions at 50%
  • 4 to quantize orientations at 50% and positions at 50%
  • 5 to quantize orientations at 25% and positions at 50%
Check here for an explanation of the bone quantization.

Return Value

This command does not return any value on success. On Failure, a warning or error is displayed, explaining its reason.

MEL Examples

glmMayaToSimulationCache -cacheDir "C:/export" -cacheName "myCache" -exportTerrainMeshes "pPlane1";
// Result: none if OK

Python Examples

import maya.cmds as cmds
cmds.glmMayaToSimulationCache(cacheDir="C:/export", cacheName="myCache", exportTerrainMeshes="pPlane1";

// Result: none if OK