Rendering VRScene Files

Golaem Crowd provides a plugin to render characters with V-Ray.
The plugin is installed under procedurals/ in Golaem Crowd's installation directory.
The file name of the plugin is vray_glmCrowdVrayPlugin.dll (.so).

Adding Golaem Crowd Characters to a VRSCENE Scene

Golaem Crowd only exports crowd related information in its VRSCENE files. These files must be included in a VRSCENE file describing a complete scene (camera, lights, geometry, etc.). Here are the steps to follow, from a Maya scene to the final image:

Step 1-Export the Maya Scene to a V-Ray Scene

This is a standard export using the Chaos Group's V-Ray plugin for Maya. To export the scene to a VRSCENE file, go to the Translator tab in V-Ray's render settings and check Export to a .vrscene file (see Figure 236).
For better readability, check the Separate files option and uncheck Write mesh data in hex format and Compressed. Then just hit the render button to export the VRSCENE file.

Step 2-Export the Maya Characters Materials & Shaders to V-Ray Scenes

Use the same settings as above to export each character of your crowd to VRSCENE files.
This step is necessary for exporting the materials and shaders of your characters. The following files will be created:
characterScene2_bitmaps.vrscene …
The Golaem Crowd V-Ray plugin will use the materials of the characters at render time; this is why they need to be included in the final scene.

Step 3-Include the Character Materials in the V-Ray Scene File

At the end of the main VRSCENE file created at step 1, add directives to include the character materials exported at step 2:
#include "[…]/characterScene1_materials.vrscene"
#include "[…]/characterScene1_textures.vrscene"
#include "[…]/characterScene1_bitmaps.vrscene"
#include "[…]/characterScene2_materials.vrscene"
#include "[…]/characterScene2_textures.vrscene"
#include "[…]/characterScene2_bitmaps.vrscene" …
Only the files related to the materials need to be included: [...]_bitmaps.vrscene, [...]_materials.vrscene and [...]_textures.vrscene. The geometry will be created procedurally (at render time) by the Golaem Crowd V-Ray plugin.

Step 4-Include the Golaem Crowd Characters in the V-Ray Scene File

Just as with the character materials, add the directives to include the VRSCENE files created with the Simulation Tool at the end of the main VRSCENE file created at step 1. If you render an animation or if motion blur is enabled, you will need to include all the Crowd VRSCENE files matching those frames.
Here is an example of the main VRSCENE file:
// Exported by V-Ray Plugins Exporter
// Thu Feb 16 11:03:15 2012
// Frame at time 10
SettingsRenderChannels vraySettingsRenderChannels {
SettingsOutput vraySettingsOutput {
// Scene includes
#include "N:/v-ray/vrayScene_lights.vrscene"
#include "N:/v-ray/vrayScene_geometry.vrscene"
#include "N:/v-ray/vrayScene_nodes.vrscene"
#include "N:/v-ray/vrayScene_materials.vrscene"
#include "N:/v-ray/vrayScene_textures.vrscene"
#include "N:/v-ray/vrayScene_bitmaps.vrscene"
// Character materials
#include "N:/v-ray/assets/character/crowdMan_materials.vrscene"
#include "N:/v-ray/assets/character/crowdMan_textures.vrscene"
#include "N:/v-ray/assets/character/crowdMan_bitmaps.vrscene"
// Crowd includes
#include "N:/export/vray/vrayScene.2250.vrscene"
#include "N:/export/vray/vrayScene.2500.vrscene"
#include "N:/export/vray/vrayScene.2750.vrscene"
If some Crowd VRSCENE files are not included and the motion blur is activated, VRay will behave strangely when interpolating the different geometry samples and render time will exponentially increase.
Example of a V-Ray crowd rendering with some missing crowd VRscene files and activated motion blur

Step 5-Render the Scene

V-Ray must be configured to load the Golaem Crowd plugin. The easiest way to do this is to set an environment variable that points towards the location of the plugin: VRAY_PLUGINS_x64. The directory of the Crowd plugin must also be added to the system path environment variable to allow V-Ray to load the plugin dependencies.
Here's an example of batch file that can be written under windows command line:
@echo off
rem launchVray.bat
rem usage example: launchVray.bat -rtEngine=0 -display=1 -sceneFile="N:\v-ray\vrayScene.vrscene"
set VRAY_PLUGINS_x64=N:\plugins\vrayPlugin
set PATH=%PATH%;%VRAY_PLUGINS_x64% %VRAY_FOR_MAYA2012_MAIN_x64%\bin\vray %*
Here's an example of batch file that can be written under linux bash command line:
#usage example: -rtEngine=0 -display=1 -sceneFile="/home/v-ray/vrayScene.vrscene"
export VRAY_PLUGINS_x64="/home/golaem/plugins/vrayPlugin"
$VRAY_FOR_MAYA2012_MAIN_x64/bin/vray $@
These scripts behave just as the V-Ray executable, taking the same parameters.
Change VRAY_FOR_MAYA2012_MAIN_x64 to the environment variable matching your V-Ray version.
To render the main VRSCENE file, open a command line in the folder of the batch file and call the batch file with the same parameters as if calling the V-Ray executable. Here are examples for the scene described above:
launchVray.bat -rtEngine=0 -display=1 -sceneFile=" "N:\v-ray\vrayScene.vrscene"