glmCrowdSimulationExporter

The glmCrowdSimulationExporter  commands exports Golaem simulation CrowdField nodes as Simulation Cache files. This command is called by the Simulation Exporter.
glmCrowdSimulationExporter [-startFrame int] [-endFrame int] [-crowdFieldNode string] [-exportFromCache bool] [-exportAssetsAssoOnly bool] [-entityIds string]

[-scExpName string] [-scExpOutDir string] [-scExpAttrs string]

[-preExportCallback string] [-preExportCallbackLanguage int] [-postExportCallback string] [-postExportCallbackLanguage int]

[-exportScreenshots bool] [-screenshotsDir string] [-screenshotsPrefix string] [-screenshotsSuffix string] [-screenshotsFormat string]

[-exportBoneQuantization int]

If you need to call this command using Maya batch, please use the glmBatchCrowdSimulationExporter command.

Flags

Global Flags

These parameters are relative to the global Simulation Exporter parameters:

Long name (short name) Argument types Properties Description
-startFrame (-sF) int mandatory start frame from which the simulation will be exported
-endFrame (-eF) int mandatory end frame to which the simulation will be exported
-crowdFieldNode (-cfn) string mandatory, multi-use name of the CrowdField nodes which will be exported
-exportFromCache (-efc) bool   if true, the export process uses Simulation Cache files which have been exported before
-exportAssetsAssoOnly (-eaa) bool   if true, only the Association file (.gscs) is exported
-entityIds (-eid) string   Entity Ids to export as a printer string (ex: "1001", "1001-5001", "1001, 2001, 5001" or "*")

Simulation Cache Files Flags

These parameters are relative to the Simulation Cache files parameters of the Simulation Exporter:

Long name (short name) Argument types Properties Description
-scExpName (-sn) string mandatory base name of the exported Simulation Cache files
-scExpOutDir (-sod) string mandatory, multi-use directories where the Simulation Cache files will be exported. It is possible to specify one directory per CrowdField (else all the files will be exported in the first specified directory)
-scExpAttrs (-sea) string mandatory, multi-use name of the ppAttributes which values will be exported in the Simulation Cache files

Callback Flags

These parameters are relative to the Simulation Exporter Callback parameters of the Simulation Exporter:

Long name (short name) Argument types Properties Description
-preExportCallback (-prc) string   MEL / Python function to call when the export starts
-preExportCallbackLanguage(-prl) int   Language of the pre-export callback: 0 for MEL, 1 for Python

-postExportCallback(-poc)

string   MEL / Python function to call when the export stops
-postExportCallbackLanguage(-pol) int   Language of the post-export callback: 0 for MEL, 1 for Python

Screenshots Flags

Long name (short name) Argument types Properties Description
-exportScreenshots (-ess) bool   export viewport screenshots
-screenshotsDir (-sdr) string   directory where the screenshots files will be written
-screenshotsPrefix (-spr) string   screenshots file name prefix
-screenshotsSuffix (-ssf) string   screenshots file name suffix (added after the frame number)
-screenshotsFormat (-sfr) string   screenshots file format. Examples of valid formats include: "als", "bmp", "cin", "gif", "iff", "jpg", "png", "tga", "tif". Default is "png"

For a given frame, the screenshot is exported to the file: [screenshotsDir]/[screenshotsPrefix][frameNumber][screenshotsSuffix].[screenshotsFormat]

Screenshots Flags

Long name (short name) Argument types Properties Description
-exportBoneQuantization (-ebq) int   Cache compression mode (from 0 to 5 in the same order than described in the Crowd Manager node).

Return Value

This command returns nothing

MEL Examples

// export Simulation Cache files only between frame 1 and 100
glmCrowdSimulationExporter -startFrame 1 -endFrame 100 -crowdFieldNode "crowdField1" -exportFromCache 0  -scExpAttrs "particleId" -entityIds "*" -scExpName "testScene" -scExpOutDir "N:/tests/export";

Python Examples

import maya.cmds as cmds
# export Simulation Cache files only between frame 1 and 100
cmds.glmCrowdSimulationExporter(startFrame=1, endFrame=100, crowdFieldNode=["crowdField1"], exportFromCache=False, scExpAttrs=["particleId"], entityIds="*", scExpName="testScene", -scExpOutDir "N:/tests/export")

Usage with Maya Batch

To batch export a batch simulation, use the glmBatchCrowdSimulationExporter command