---
title: "Exporting V-Ray Scene Files"
canonical: "https://documentation.chaos.com/space/APPSDK/132678894/Exporting%20V-Ray%20Scene%20Files"
format: markdown
---
This page provides information on V-Ray Scene Files (*.vrscene*) - how to export them so that they could be used in other workflows.

## **Overview**

---

The .*vrscene* file format is an ASCII file that can be exported from App SDK and other platforms that use V-Ray. It contains all the information about the scene such as geometry, lights, and shaders, and can be rendered with the [V-Ray Standalone](https://docs-chaos.atlassian.net/wiki/spaces/VNS). This functionality can transfer lights and entire assets with their textures and materials between V-Ray platforms. Animation is also included.

## **Exporting V-Ray Scene Files**

---

The <span style="color: #cfcbc5">.vrscene</span> file could be exported by invoking the corresponding method of the VRayRenderer. It could be customized with various options, such as:

- **compressed **- enables zlib compression of large data arrays (requires hexArrays==true)
- **hexArrays **- data arrays will be encoded in hex
- **hexTransforms **- transforms will be encoded in hex (mainly useful with large instancers)
- **renderElementsSeparateFolders **- controls the default value of SettingsOutput.relements_separateFolders
- **printHeader **- whether to write the comment section with version and time info
- **currentFrameOnly **- if true only the current keyframe is exported, otherwise the whole timeline
- **incremental **- valid only when currentFrameOnly=true && appendFrameSuffix=false - set to true to incrementally append keyframe data after initial export with false
- **appendFrameSuffix **- valid only when currentFrameOnly=true - appends a %04d frame number to the file name
- **stripPaths **- If enabled, the paths for bitmap textures and other external files are stripped from the file so that only the filenames remain.
- **leftInterval **- Valid only when currentFrameOnly=true. The (closed) time interval left of the current time in which to include keyframes - i.e. [left, right). Value 0.0 means automatic 1 frame based on FPS.
- **rightInterval **- Valid only when currentFrameOnly=true. The (open) time interval right of the current time in which to include keyframes - i.e. [left, right). Value 0.0 means automatic 1 frame based on FPS.
- **subFileInfos **- A list of files to split the scene into, based on plugin type. See SubFileInfo type comments.
- **pluginExportList **- If this is not empty, only these plugins will be exported instead of all plugins in the scene.
- **additionalIncludeFiles **- Optional list of files to #include at the end of the main vrscene
- **hostAppString **- An optional string identifying the host application, version, etc.
- **vrdataExport **- Enable or disable vrdata file writing.
- **vrdataSmallBufferSizeLimit **- Set a limit for the min size of the buffer. If the buffer is smaller it is not written to the vrdata file.
- **vrdataFileSizeLimitMiB **- Limit the size of the vrdata file. If this limit is reached another file is started.
- **vrfilesExport **- Enable or disable vrfiles file writing.
- **sceneBasePath **- Optional absolute scene base path that can be used for resolving relative paths for the .vrfiles file.
- **vrfilesComputeHashes **- True if MD5 and SHA256 hashes should be computed and written in the .vrfiles file for each resolved asset file.

## **Code example**

---

Here is a sample usage of the export functionality:

<details>
<summary>Python</summary>

```python
# Compatibility with Python 2.7.
from __future__ import print_function

# The directory containing the vray shared object should be
# present in the PYTHONPATH environment variable.
# Try to import the vray module from VRAY_SDK/python, if it is not in PYTHONPATH
import sys, os
VRAY_SDK = os.environ.get('VRAY_SDK')
if VRAY_SDK:
    sys.path.append(os.path.join(VRAY_SDK, 'python'))
import vray

SCENE_PATH = os.path.join(VRAY_SDK, 'scenes')
# Change process working directory to SCENE_PATH in order to be able to load relative scene resources.
os.chdir(SCENE_PATH)

# Create an instance of VRayRenderer with default options.
# The renderer is automatically closed after the `with` block.
with vray.VRayRenderer() as renderer:
    # Register a simple log callback. Always useful for debugging.
    def dumpMsg(renderer, message, level, instant):
        if level == vray.LOGLEVEL_ERROR:
            print("[ERROR]", message)
        elif level == vray.LOGLEVEL_WARNING:
            print("[Warning]", message)
        elif level == vray.LOGLEVEL_INFO:
            print("[info]", message)
        # Uncomment for testing, but you might want to ignore these in real code
        # else: print("[debug]", message)

    renderer.setOnLogMessage(dumpMsg)
    globalExportSettings = {}
    # Enable compression of large data arrays.
    globalExportSettings["hexArrays"] = True
    globalExportSettings["compressed"] = True
    # Keep transforms in human readable format
    globalExportSettings["hexTransforms"] = False
    # Print header to the export file
    globalExportSettings["printHeader"] = True
    # Export only the current frame.
    globalExportSettings["currentFrameOnly"] = True
    # Keep incremental off for the first frame so all plugins are exporeted properly.
    globalExportSettings["incremental"] = False
    # Separate the views and nodes in different files
    viewSubFileInfo = {"type": 'view', "suffix": 'view'}
    nodeSubFileInfo = {"type": 'nodes', "suffix": 'nodes'}
    globalExportSettings["subFileInfos"] = [viewSubFileInfo, nodeSubFileInfo]

    firstFrame = True

    def stateChanged(renderer, oldState, newState, instant):
        global firstFrame
        global globalExportSettings
        if newState == vray.RENDERER_STATE_IDLE_FRAME_DONE:
            renderer.export("export.vrscene", globalExportSettings)
            print("Frame", renderer.frame, "exported")

            if firstFrame:
                globalExportSettings["incremental"] = True
                firstFrame = False

            renderer.continueSequence()

    renderer.setOnStateChanged(stateChanged)
    # Load scene from a file.
    renderer.load(os.path.join(SCENE_PATH, "animation.vrscene"))
    # Maximum paths per pixel for interactive mode. Set a low sample level to complete rendering faster.
    renderer.setInteractiveSampleLevel(5)

    # Export just the plugins associated with the cube.
    settings = {}
    settings["pluginExportList"] = [
        renderer.plugins['pCubeShape1@node'],
        renderer.plugins['pCubeShape1@mesh5'],
        renderer.plugins['VRayMtl1@material'],
        renderer.plugins['VRayMtl1@diffuse']]

    renderer.export("export_cube.vrscene", settings)

    # Start the sequence.
    renderer.renderSequence()
    # Wait for the renderer to finish.
    renderer.waitForSequenceEnd()
```
</details>

<details>
<summary>C++</summary>

```c++
#define VRAY_RUNTIME_LOAD_PRIMARY
#include "vraysdk.hpp"
#include "vrayplugins.hpp"
#include "utils.h"

using namespace VRay;
using namespace VRay::Plugins;
using namespace std;

const char *BASE_PATH = getenv("VRAY_SDK");
string SCENE_PATH = (BASE_PATH ? string(BASE_PATH) : string(".")) + PATH_DELIMITER + "scenes";

VRayExportSettings globalExportSettings;

void stateChanged(VRayRenderer &renderer, RendererState oldState, RendererState newState, double instant, void* data){
	if (newState == RendererState::IDLE_FRAME_DONE) {
		static bool firstFrame = true;
		// Export the current frame
		renderer.exportScene("export.vrscene", globalExportSettings);
		printf("Frame %d exported\
", renderer.getCurrentFrame());
		// Turn the incremental option on to append each frame to the same file.
		if (firstFrame) {
			globalExportSettings.incremental = true;
			firstFrame = false;
		}
		renderer.continueSequence();
	}
}

int main() {
	// Change process working directory to SCENE_PATH in order to be able to
	// load relative scene resources.
	changeCurrentDir(SCENE_PATH.c_str());
	// Load V-Ray SDK library.
	VRayInit init(NULL, true);
	// Create an instance of VRayRenderer with default options.
	// The renderer is automatically closed at the end of the current scope.
	VRayRenderer renderer;
	// It's recommended to always have a console log
	renderer.setOnLogMessage(logMessage);
	// Enable compression of large data arrays.
	globalExportSettings.hexArrays = true;
	globalExportSettings.compressed = true;
	// Keep transforms in human readable format
	globalExportSettings.hexTransforms = false;
	// Print header to the export file
	globalExportSettings.printHeader = true;
	// Export only the current frame.
	globalExportSettings.currentFrameOnly = true;
	// Keep incremental off for the first frame so all plugins are exported properly.
	globalExportSettings.incremental = false;
	// Separate the views and nodes in different files
	SubFileInfo views = { "view", "view" };
	globalExportSettings.subFileInfos.push_back(views);
	SubFileInfo nodes = { "nodes", "nodes" };
	globalExportSettings.subFileInfos.push_back(nodes);
	renderer.setOnStateChanged(stateChanged);
	// Load scene from a file.
	renderer.load("animation.vrscene");
	// Maximum paths per pixel for interactive mode. Set a low sample level to complete rendering faster.
	renderer.setInteractiveSampleLevel(5);

	// Export just the plugins associated with the cube.
	VRayExportSettings settings;
	settings.pluginExportList.push_back(renderer.getPlugin("pCubeShape1@node"));
	settings.pluginExportList.push_back(renderer.getPlugin("pCubeShape1@mesh5"));
	settings.pluginExportList.push_back(renderer.getPlugin("VRayMtl1@material"));
	settings.pluginExportList.push_back(renderer.getPlugin("VRayMtl1@diffuse"));

	renderer.exportScene("export_cube.vrscene", settings);
	
	// Start the sequence.
	renderer.renderSequence();
	// Wait for the renderer to finish.
	renderer.waitForSequenceEnd();
	return 0;
}
```
</details>

<details>
<summary>C#.NET</summary>

```csharp
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VRay;

class Program
{		
	static void Main(string[] args)
	{
		string SCENE_PATH = Path.Combine(Environment.GetEnvironmentVariable("VRAY_SDK"), "scenes");
		ExportSettings globalExportSettings = new ExportSettings();
		// Change process working directory to SCENE_PATH in order to be able to load relative scene resources.
		Directory.SetCurrentDirectory(SCENE_PATH);
		// Create an instance of VRayRenderer with default options.
		// The renderer is automatically closed after the `using` block.
		using (VRayRenderer renderer = new VRayRenderer())
		{
			// Add a listener for any type of log message.
			renderer.LogMessage += new EventHandler<MessageEventArgs>((source, e) =>
			{
				// You can remove the if for testing, but you might want to ignore Debug in real code
				if (e.LogLevel != LogLevelType.Debug)
				{
					Console.WriteLine(String.Format("[{0}] {1}", e.LogLevel.ToString(), e.Message));
				}
			});

			// Enable compression of large data arrays.
			globalExportSettings.HexArrays = true;
			globalExportSettings.Compressed = true;
			// Keep transforms in human readable format
			globalExportSettings.HexTransforms = false;
			// Print header to the export file
			globalExportSettings.PrintHeader = true;
			// Export only the current frame.
			globalExportSettings.CurrentFrameOnly = true;
			// Keep incremental off for the first frame so all plugins are exporeted properly.
			globalExportSettings.Incremental = false;
			// Separate the views and nodes in different files
			SubFileInfo views = new SubFileInfo(SubFileInfo.PluginType.View, "views");
			globalExportSettings.AddSubFileInfo(views);
			SubFileInfo nodes = new SubFileInfo(SubFileInfo.PluginType.Node, "nodes");
			globalExportSettings.AddSubFileInfo(nodes);

			bool firstFrame = true;
			renderer.StateChanged += new EventHandler<StateChangedEventArgs>((source, e) =>
			{
				if(e.NewState == VRayRenderer.RendererState.IDLE_FRAME_DONE)
				{					
					// Export the current frame
					renderer.Export("export.vrscene", globalExportSettings);
					Console.WriteLine("Frame {0} exported\
", renderer.Frame);

					// Turn the incremental option on to append each frame to the same file.	
					if (firstFrame)
					{
						globalExportSettings.Incremental = true;
						firstFrame = false;
					}
					renderer.ContinueSequence();
				}
			});

			// Load scene from a file.
			renderer.Load("animation.vrscene");
			// Maximum paths per pixel for interactive mode. Set a low sample level to complete rendering faster.
			renderer.SetInteractiveSampleLevel(5);

			// Export just the plugins associated with the cube.
			ExportSettings settings = new ExportSettings();
			settings.PluginExportList.Add(renderer.GetPlugin("pCubeShape1@node"));
			settings.PluginExportList.Add(renderer.GetPlugin("pCubeShape1@mesh5"));
			settings.PluginExportList.Add(renderer.GetPlugin("VRayMtl1@material"));
			settings.PluginExportList.Add(renderer.GetPlugin("VRayMtl1@diffuse"));

			renderer.Export("export_cube.vrscene", settings);

			// Start the sequence.
			renderer.RenderSequence();
			// Wait for the renderer to finish.
			renderer.WaitForSequenceEnd();
		}
	}
}
```
</details>

<details>
<summary>Node.js</summary>

```javascript
var path = require("path");
var vray = require(path.join(process.env.VRAY_SDK, "node", "vray"));

var SCENE_PATH = path.join(process.env.VRAY_SDK, "scenes");
// Change process working directory to SCENE_PATH in order to be able to load relative scene resources.
process.chdir(SCENE_PATH);

// Create an instance of VRayRenderer with default options.
var renderer = vray.VRayRenderer();
// It's recommended to always have a console log callback
renderer.on("logMessage", function(message, level, instant) {
	if (level == vray.LOGLEVEL_ERROR)
		console.log("[ERROR] ", message);
	else if (level == vray.LOGLEVEL_WARNING)
		console.log("[Warning] ", message);
	else if (level == vray.LOGLEVEL_INFO)
		console.log("[info] ", message);
	// Uncomment for testing, but you might want to ignore these in real code
	//else console.log("[debug] ", message);
});

var globalExportSettings = {};
// Enable compression of large data arrays.
globalExportSettings.hexArrays = true;
globalExportSettings.compressed = true;
// Keep transforms in human readable format
globalExportSettings.hexTransforms = false;
// Print header to the export file
globalExportSettings.printHeader = true;
// Export only the current frame.
globalExportSettings.currentFrameOnly = true;
// Keep incremental off for the first frame so all plugins are exporeted properly.
globalExportSettings.incremental = false;
// Separate the views and nodes in different files
var viewSubFileInfo = {type: "view", suffix: "view"};
var nodeSubFileInfo = {type: "nodes", suffix: "nodes"};
globalExportSettings.subFileInfos = [viewSubFileInfo, nodeSubFileInfo];

var firstFrame = true;
renderer.on("stateChanged", function(oldState, newState, instant) {
	if (newState == 'idleFrameDone') {
		// Export the current frame
		renderer.export("export.vrscene", globalExportSettings, function(err) {
			if (err) throw err;
			console.log("Frame ", renderer.frame, " exported");
			
			if(firstFrame) {
				globalExportSettings.incremental = true;
				firstFrame = false;
			}
			renderer.continueSequence();
		});		
	}
});

// Load scene from a file.
renderer.load("animation.vrscene", function(err){
	if (err) throw err;
	// Maximum paths per pixel for interactive mode. Set a low sample level to complete rendering faster.
	renderer.setInteractiveSampleLevel(5);
	// Export just the plugins associated with the cube.
	var settings = {};
	settings.pluginExportList = [
		renderer.plugins["pCubeShape1@node"],
		renderer.plugins["pCubeShape1@mesh5"],
		renderer.plugins["VRayMtl1@material"],
		renderer.plugins["VRayMtl1@diffuse"]];

	renderer.export("export_cube.vrscene", settings, function(err){
		if (err) throw err;
		// Start the sequence.
		renderer.renderSequence();

		// Wait for the renderer to finish.
		renderer.waitForSequenceEnd(function() {
			// Closes the renderer.
			// The renderer object is unusable after closing since its resources
			// are freed. It should be released for garbage collection.
			renderer.close();
		});
	});
});
```
</details>

## **V-Ray Scene Files Version 2**

---

<span style="color: #000000">Starting with V-Ray 6.1, a new version of the </span><span style="color: #000000">*.vrscene*</span><span style="color: #000000"> format is available. The new version 2</span><span style="color: #000000">* .vrscene *</span><span style="color: #000000">format is smaller in size and optimized for more efficient upload. It has features that aim to make it easier to render on a machine different from the one it was exported from. Version 1 format contains only the .vrscene file. A version 2 scene differs from version 1 as it has at least three files - a </span><span style="color: #000000">*.vrscene*</span><span style="color: #000000">, a </span><span style="color: #000000">*.vrdata*</span><span style="color: #000000"> and a </span><span style="color: #000000">*.vrfiles*</span><span style="color: #000000"> file.</span>

<span style="color: #000000">If V-Ray scenes are distributed between different machines, which could not have all necessary assets in the scene, or a rendering job is submitted to Chaos Cloud, a functionality similar to the </span><span style="color: #000000">[pack command of the Chaos Cloud Client](https://docs-chaos.atlassian.net/wiki/spaces/VCLOUD/pages/126076078)</span><span style="color: #000000"> would be useful.</span>

<span style="color: #000000">A detailed example how to pack a version 2 </span><span style="color: #000000">*.vrscene*</span><span style="color: #000000"> file with its companion (sidecar) files is available in </span>`examples/{language}/advanced/12-sidecar-scene-export`

<details>
<summary>Python</summary>

```python
# Compatibility with Python 2.7.
from __future__ import print_function
import sys, os
import vrfiles_parser as parser

# The directory containing the vray shared object should be present in the PYTHONPATH environment variable.
# Try to import the vray module from VRAY_SDK/python, if it is not in PYTHONPATH
VRAY_SDK = os.environ.get('VRAY_SDK')
if VRAY_SDK:
    sys.path.append(os.path.join(VRAY_SDK, 'python'))
import vray

SCENE_PATH = os.path.join(VRAY_SDK, 'scenes')

# The name of the scene to be loaded
sceneName = 'cornell_new'
# The suffix to distinguish the exported file
exportedSuffix = '_sidecar'
# The name of the folder for storing the copied assets
resourcesName = 'resources'

# Change process working directory to SCENE_PATH in order to be able to load relative scene resources.
os.chdir(SCENE_PATH)

# Create an instance of VRayRenderer with default options.
# The renderer is automatically closed after the `with` block.
with vray.VRayRenderer() as renderer:
    # Register a simple log callback. Always useful for debugging.
    def dumpMsg(renderer, message, level, instant):
        if level == vray.LOGLEVEL_ERROR:
            print("[ERROR]", message)
        elif level == vray.LOGLEVEL_WARNING:
            print("[Warning]", message)
        elif level == vray.LOGLEVEL_INFO:
            print("[info]", message)
        # Uncomment for testing, but you might want to ignore these in real code
        # else: print("[debug]", message)

    renderer.setOnLogMessage(dumpMsg)
    # Load scene from a file.
    renderer.load(sceneName + parser.vrsceneExt)

    # Export with settings for companion (sidecar) files - vrdata and vrfiles
    # It is particularly useful when we have a vrscene containing:
    # - large data buffers, which could possibly be duplicated between the plugins
    # - various absolute or relative paths to referenced files - textures, OCIO configs, meshes, materials, etc.
    #   The files existing on the machine, which did the export, may not exist on another machine
    settings = {}

    # Enable vrdata files to be exported (default is false)
    settings['vrdataExport'] = True
    # If the buffer size in bytes is smaller than this value, it is not written to the vrdata file. (default is 2048 bytes)
    settings['vrdataSmallBufferSizeLimit'] = 2048
    # Limit the size (MiB) of the vrdata file. If this limit is reached another file is started. (default is 0 - no limit)
    settings['vrdataFileSizeLimitMiB'] = 0
    # Enable vrfiles files to be exported (default is false)
    settings['vrfilesExport'] = True
    # Enable computation and writing to the vfiles of MD5 and SHA256 hashes for each resolved asset file (default is false)
    settings['vrfilesComputeHashes'] = True
    # Optional absolute scene base path that can be used for resolving relative paths for the vrfiles file.
    settings['sceneBasePath'] = SCENE_PATH

    # Export the scene - the following directive is written in the beginning the vrscene file 
    # #version 2
    exportedScene = sceneName + exportedSuffix
    success = renderer.export(exportedScene + parser.vrsceneExt, settings)
    if success:
        # Copies all assets and files related to the exportedScene to the destFolder
        # and rewrites the absolute actual paths in the vrfiles to relative ones
        parser.packExportedVrscene(exportedScene, sceneName, resourcesName)
        # The destFolder could be then packed and sent for rendering on another machine
        # We could also load it locally and start rendering
        os.chdir(sceneName)
        renderer.load(exportedScene + parser.vrsceneExt)
        renderer.start()
        renderer.waitForRenderEnd(15000)
```
</details>

<details>
<summary>C++</summary>

```c++
#define VRAY_RUNTIME_LOAD_PRIMARY
#include "vraysdk.hpp"
#include "vrayplugins.hpp"
#include "vrfiles_parser.h"

using namespace VRay;
using namespace VRay::Plugins;
using namespace std;

const char *BASE_PATH = getenv("VRAY_SDK");
const string SCENE_PATH = (BASE_PATH ? string(BASE_PATH) : string(".")) + PATH_DELIMITER + "scenes";

// The name of the scene to be loaded
static const string sceneName = "cornell_new";
// The suffix to distinguish the exported file
static const string exportedSuffix = "_sidecar";
// The name of the folder for storing the copied assets
static const string resourcesName = "resources";

int main() {
	// Change process working directory to SCENE_PATH in order to be able to load relative scene resources.
	changeCurrentDir(SCENE_PATH.c_str());
	// Load V-Ray SDK library.
	VRayInit init(NULL, true);
	// Create an instance of VRayRenderer with default options.
	VRayRenderer renderer;
	// It's recommended to always have a console log
	renderer.setOnLogMessage(logMessage);
	// Load scene from a file.
	renderer.load(sceneName + vrsceneExt);

	// Export with settings for companion (sidecar) files - vrdata and vrfiles
	// It is particularly useful when we have a vrscene containing:
	// - large data buffers, which could possibly be duplicated between the plugins
	// - various absolute or relative paths to referenced files - textures, OCIO configs, meshes, materials, etc.
	//   The files existing on the machine, which did the export, may not exist on another machine
	VRayExportSettings settings;
	// Enable vrdata files to be exported (default is false)
	settings.vrdataExport = true;
	// If the buffer size in bytes is smaller than this value, it is not written to the vrdata file. (default is 2048 bytes)
	settings.vrdataSmallBufferSizeLimit = 2048;
	// Limit the size (MiB) of the vrdata file. If this limit is reached another file is started. (default is 0 - no limit)
	settings.vrdataFileSizeLimitMiB = 0;
	// Enable vrfiles files to be exported (default is false)
	settings.vrfilesExport = true;
	// Enable computation and writing to the vfiles of MD5 and SHA256 hashes for each resolved asset file (default is false)
	settings.vrfilesComputeHashes = true;
	// Optional absolute scene base path that can be used for resolving relative paths for the vrfiles file.
	settings.sceneBasePath = SCENE_PATH;

	// Export the scene - the following directive is written in the beginning the vrscene file 
	// #version 2
	string exportedScene = sceneName + exportedSuffix;
	int err = renderer.exportScene(exportedScene + vrsceneExt, settings);
	if (!err) {
		// Copies all assets and files related to the exportedScene to the destFolder
		// and rewrites the absolute actual paths in the vrfiles to relative ones
		VRFilesParser::packExportedVrscene(exportedScene, sceneName, resourcesName);

		// The destFolder could be then packed and sent for rendering on another machine
		// We could also load it locally and start rendering
		changeCurrentDir(sceneName.c_str());
		renderer.load(exportedScene + vrsceneExt);
		renderer.startSync();
		renderer.waitForRenderEnd(15000);
	}
	return 0;
}
```
</details>

<details>
<summary>C#.NET</summary>

```csharp
using System;
using System.IO;
using VRay;

class Program
{
	// The name of the scene to be loaded
	const string sceneName = "cornell_new";
	// The suffix to distinguish the exported file
	const string exportedSuffix = "_sidecar";
	// The name of the folder for storing the copied assets
	const string resourcesName = "resources";

	static void Main(string[] args)
	{
		string SCENE_PATH = Path.Combine(Environment.GetEnvironmentVariable("VRAY_SDK"), "scenes");
		// Change process working directory to SCENE_PATH in order to be able to load relative scene resources.
		Directory.SetCurrentDirectory(SCENE_PATH);
		// Create an instance of VRayRenderer with default options.
		// The renderer is automatically closed after the `using` block.
		using (VRayRenderer renderer = new VRayRenderer())
		{
			// Add a listener for any type of log message.
			renderer.LogMessage += new EventHandler<MessageEventArgs>((source, e) =>
			{
				// You can remove the if for testing, but you might want to ignore Debug in real code
				if (e.LogLevel != LogLevelType.Debug)
				{
					Console.WriteLine(String.Format("[{0}] {1}", e.LogLevel.ToString(), e.Message));
				}
			});
			// Load scene from a file.
			renderer.Load(sceneName + VRFilesParser.VrsceneExt);

			// Export with settings for companion (sidecar) files - vrdata and vrfiles
			// It is particularly useful when we have a vrscene containing:
			// - large data buffers, which could possibly be duplicated between the plugins
			// - various absolute or relative paths to referenced files - textures, OCIO configs, meshes, materials, etc.
			//   The files existing on the machine, which did the export, may not exist on another machine
			ExportSettings settings = new ExportSettings();

			// Enable vrdata files to be exported (default is false)
			settings.VrdataExport = true;
			// If the buffer size in bytes is smaller than this value, it is not written to the vrdata file. (default is 2048 bytes)
			settings.VrdataSmallBufferSizeLimit = 2048;
			// Limit the size (MiB) of the vrdata file. If this limit is reached another file is started. (default is 0 - no limit)
			settings.VrdataFileSizeLimitMiB = 0;
			// Enable vrfiles files to be exported (default is false)
			settings.VrfilesExport = true;
			// Enable computation and writing to the vfiles of MD5 and SHA256 hashes for each resolved asset file (default is false)
			settings.VrfilesComputeHashes = true;
			// Optional absolute scene base path that can be used for resolving relative paths for the vrfiles file.
			settings.SceneBasePath = SCENE_PATH;

			// Export the scene - the following directive is written in the beginning the vrscene file 
			// #version 2
			string exportedScene = sceneName + exportedSuffix;
			bool success = renderer.Export(exportedScene + VRFilesParser.VrsceneExt, settings);
			if (success)
			{
				// Copies all assets and files related to the exportedScene to the destFolder
				// and rewrites the absolute actual paths in the vrfiles to relative ones
				VRFilesParser.PackExportedVrscene(exportedScene, sceneName, resourcesName);

				// The destFolder could be then packed and sent for rendering on another machine
				// We could also load it locally and start rendering
				Directory.SetCurrentDirectory(sceneName);
				renderer.Load(exportedScene + VRFilesParser.VrsceneExt);
				renderer.StartSync();
				renderer.WaitForRenderEnd(15000);
			}
		}
	}
}
```
</details>

<details>
<summary>Node.js</summary>

```javascript
const parser = require("./vrfiles_parser");
const vray = require(parser.path.join(process.env.VRAY_SDK, "node", "vray"));
const SCENE_PATH = parser.path.join(process.env.VRAY_SDK, "scenes");

// The name of the scene to be loaded
const sceneName = "cornell_new";
// The suffix to distinguish the exported file
const exportedSuffix = "_sidecar";
// The name of the folder for storing the copied assets
const resourcesName = "resources";

// Change process working directory to SCENE_PATH in order to be able to load relative scene resources.
process.chdir(SCENE_PATH);

// Create an instance of VRayRenderer with default options.
var renderer = vray.VRayRenderer();
// It's recommended to always have a console log callback
renderer.on("logMessage", function (message, level, instant) {
	if (level == vray.LOGLEVEL_ERROR)
		console.log("[ERROR] ", message);
	else if (level == vray.LOGLEVEL_WARNING)
		console.log("[Warning] ", message);
	else if (level == vray.LOGLEVEL_INFO)
		console.log("[info] ", message);
	// Uncomment for testing, but you might want to ignore these in real code
	//else console.log("[debug] ", message);
});

// Load scene from a file.
renderer.load(sceneName + parser.vrsceneExt, function (err) {
	if (err) throw err;

	// Export with settings for companion (sidecar) files - vrdata and vrfiles
	// It is particularly useful when we have a vrscene containing:
	// - large data buffers, which could possibly be duplicated between the plugins
	// - various absolute or relative paths to referenced files - textures, OCIO configs, meshes, materials, etc.
	//   The files existing on the machine, which did the export, may not exist on another machine
	var settings = {};

	// Enable vrdata files to be exported (default is false)
	settings.vrdataExport = true;
	// If the buffer size in bytes is smaller than this value, it is not written to the vrdata file. (default is 2048 bytes)
	settings.vrdataSmallBufferSizeLimit = 2048;
	// Limit the size (MiB) of the vrdata file. If this limit is reached another file is started. (default is 0 - no limit)
	settings.vrdataFileSizeLimitMiB = 0;
	// Enable vrfiles files to be exported (default is false)
	settings.vrfilesExport = true;
	// Enable computation and writing to the vfiles of MD5 and SHA256 hashes for each resolved asset file (default is false)
	settings.vrfilesComputeHashes = true;
	// Optional absolute scene base path that can be used for resolving relative paths for the vrfiles file.
	settings.sceneBasePath = SCENE_PATH;

	// Export the scene - the following directive is written in the beginning the vrscene file 
	// #version 2
	var exportedScene = sceneName + exportedSuffix;
	renderer.export(exportedScene + parser.vrsceneExt, settings, function (err) {
		if (err) throw err;

		// Copies all assets and files related to the exportedScene to the destFolder
		// and rewrites the absolute actual paths in the vrfiles to relative ones
		parser.packExportedVrscene(exportedScene, sceneName, resourcesName, function(err) {
			if (err) throw err;

			// The destFolder could be then packed and sent for rendering on another machine
			// We could also load it locally and start rendering
			process.chdir(sceneName);
			renderer.load(exportedScene + parser.vrsceneExt, function (err) {
				if (err) throw err;
				renderer.start(function (err) {
					if (err) throw err;
					renderer.waitForRenderEnd(15000, function () {
						// Closes the renderer.
						// The renderer object is unusable after closing since its resources
						// are freed. It should be released for garbage collection.
						renderer.close();
					});
				});
			});
		});
	});
});
```
</details>