---
title: "vrayCreateProxy"
canonical: "https://documentation.chaos.com/space/VMAYA/111741412/vrayCreateProxy"
format: markdown
---
## **Overview**

---

<span style="color: #000000"> The .</span>*vrmesh*<span style="color: #000000"> files and proxy objects can be created through the </span><span style="color: #000000">**vrayCreateProxy**</span><span style="color: #000000"> command. Using the command with different flags allows you to export geometry to proxy files and load files to V-Ray Proxy objects.</span>

> Macro (ui-text-box)
> 
> You can use the vrayCreateProxy command with both MEL and Python. For the purpose of the documentation, the examples below are written in MEL.

> Macro (ui-text-box)
> 
> For a list of all available arguments, run the command with the -help flag in the Maya Script Editor: **vrayCreateProxy**<span style="color: #000000"> </span><span style="color: #000000">**-help**</span><span style="color: #000000">.</span>

##   
<span style="color: #000000">**Syntax**</span>

---


<span style="color: #000000">The various options are described below:</span>

| **Option** | **Description** |
| --- | --- |
| <span style="color: #172b4d">-</span><span style="color: #222222">createProxyNode </span> | <span style="color: #000000">After successful export, replaces the original geometry with proxy nodes. </span>Can also be used along with the -existing option to load an existing proxy file.  
<span style="color: #172b4d">Returns a list of the names of the transform nodes directly above the created nodes.</span> |
| <span style="color: #172b4d">-</span><span style="color: #000000">dir</span> | <span style="color: #000000">Specifies the path where the </span>*.vrmesh*<span style="color: #000000"> file(s) will be created.</span> |
| <span style="color: #172b4d">-</span>existing | Uses existing vrmesh file instead of creating a new one. |
| <span style="color: #172b4d">-</span><span style="color: #000000">node</span> | The name for the new proxy node when -createProxyNode is specified, and a single proxy is created. |
| <span style="color: #172b4d">-</span>animStart | Override start frame when importing a sequence of files with <frame> filename tag. |
| <span style="color: #172b4d">-</span>animLength | Override end frame when importing a sequence of files with <frame> filename tag. |
| <span style="color: #172b4d">-</span><span style="color: #222222">objectPath </span> | Starting path in the Alembic object hierarchy when importing .abc files |
| <span style="color: #172b4d">-</span>geomToLoad | Type of geometry to load:4<br><span style="color: #000000"> 1- None</span><br><span style="color: #000000"> 2 - Bounding Box</span><br><span style="color: #000000"> 3 - Preview</span><br><span style="color: #000000"> </span><br><span style="color: #000000"> 4 - Full geometry</span> |
| <span style="color: #172b4d">-</span>flipAxis | Transforms from Max to Maya coordinate system. |
| <span style="color: #172b4d">-</span>noMaterial | If specified, does not create a VRayMeshMaterial for the proxy. |
| -vrayImportProxyRules | Imports material override rules (.xml) from a specified location. |
| -vrayExportProxyRules | Exports material override rules (.xml) to a specified location. |
| <span style="color: #172b4d">-</span><span style="color: #222222">newProxyNode </span> | <span style="color: #222222">Uses the new VRayProxy node instead of the old VRayMesh.</span> |
| <span style="color: #172b4d">-</span><span style="color: #000000">animOn</span> | <span style="color: #000000">If specified, animated </span>*.vrmesh*<span style="color: #000000"> files are created.</span> |
| <span style="color: #172b4d">-</span><span style="color: #000000">animType</span> | <span style="color: #000000">If -animOn is specified, this option determines the animation interval to export:</span><br><span style="color: #000000"> 1 - playback range</span><br><span style="color: #000000"> 2 - animation range</span><br><span style="color: #000000"> 3 - explicit frame range specified with -startFrame and -endFrame</span> |
| <span style="color: #172b4d">-</span><span style="color: #000000">startFrame</span> | <span style="color: #000000">Specifies the start animation frame when using explicit range.</span> |
| <span style="color: #172b4d">-</span><span style="color: #000000">endFrame</span> | <span style="color: #000000">Specifies the end animation frame when using explicit range.</span> |
| -exportHierarchy | Exports full paths including transforms and groups instead of just shape names. |
| <span style="color: #172b4d">-</span><span style="color: #000000">exportType</span> | <span style="color: #000000">Specifies the type of export:</span><br><span style="color: #000000"> 1 - export all selected objects in a single </span><span style="color: #000000">*.vrmesh*</span><span style="color: #000000"> file.</span><br><span style="color: #000000"> 2 - export each selected object in a separate </span><span style="color: #000000">*.vrmesh*</span><span style="color: #000000"> file.</span> |
| <span style="color: #172b4d">-</span><span style="color: #000000">fname</span> | <span style="color: #000000">Specifies the file name when exporting to multiple </span>*.vrmesh*<span style="color: #000000"> files.</span> |
| <span style="color: #172b4d">-</span>facesPerVoxel | <span style="color: #000000">An integer value that specifies the maximum number of faces that a voxel can hold.</span> |
| <span style="color: #172b4d">-</span>oneVoxelPerMesh | If specified, <span style="color: #000000">export each separate mesh to a single voxel.</span> |
| <span style="color: #172b4d">-</span><span style="color: #000000">ignoreHiddenObjects</span> | <span style="color: #000000">If specified, hidden objects are not exported.</span> |
| <span style="color: #172b4d">-</span>includeTransformation | <span style="color: #000000">If specified and</span> <span style="color: #000000">exporting objects in separate files</span> <span style="color: #000000">, bake the transformation of each object into the vertex positions in the resulting </span><span style="color: #000000">*.vrmesh*</span><span style="color: #000000"> files.</span> |
| <span style="color: #172b4d">-</span><span style="color: #000000">makeBackup</span> | <span style="color: #000000">Create a backup </span>*.ma*<span style="color: #000000"> file containing just the exported objects.</span> |
| <span style="color: #172b4d">-</span><span style="color: #000000">overwrite</span> | <span style="color: #000000">If specified, any existing</span>* .vrmesh*<span style="color: #000000"> files will be overwritten; otherwise, an error will be printed.</span> |
| <span style="color: #172b4d">-</span><span style="color: #000000">previewFaces</span> | <span style="color: #000000">Specifies the number of faces in the viewport preview for the proxy object.</span> |
| <span style="color: #172b4d">-</span>previewType | The simplification method to use when generating a preview. Must be one of the following:<br>"clustering"<br>"edge_collapse"<br>"face_sampling"<br>"combined" |
| <span style="color: #172b4d">-l</span><span style="color: #222222">astSelectedAsPreview </span> | <span style="color: #222222">Uses the last selected object as a preview mesh.</span> |
| <span style="color: #172b4d">-</span>pointSize | If higher than 0.0, create a point cloud representation of the mesh. The specified value is used as a minimum size of the disk samples. |
| <span style="color: #172b4d">-</span><span style="color: #000000">velocityIntervalEnd</span> | <span style="color: #000000">A value between 0.0 and 1.0 with the time position within a frame for the ending vertex positions. </span> |
| <span style="color: #172b4d">-</span><span style="color: #000000">velocityIntervalStart</span> | <span style="color: #000000">A value between 0.0 and 1.0 with the time position within a frame for the initial vertex positions.</span> |
| <span style="color: #172b4d">-</span><span style="color: #000000">velocityOn</span> | <span style="color: #000000">If specified, vertex velocity is also exported. This enables motion blur and smooth interpolation of the resulting animated proxies. </span>  
<span style="color: #000000">The time samples within a frame for computing the velocity are specified with the -velocityIntervalStart and -velocityIntervalEnd options.</span> |
| <span style="color: #172b4d">-</span><span style="color: #000000">vertexColorsOn</span> | <span style="color: #000000">If specified, vertex color sets are also exported.</span> |

## **Examples**

---


### Export Mesh Example

<span style="color: #000000">The command operates on the current selection and has the following syntax, where curly braces {} denote a choice between several values separated by a pipe |, and options in brackets [] are optional:</span>

**Single proxy export:**

```
vrayCreateProxy -exportType {1|2} -previewFaces $previewFaces -dir $path -fname $filename [-makeBackup] [-vertexColorsOn] [-ignoreHiddenObjects] [-includeTransformation] [-oneVoxelPerMesh] [-facesPerVoxel $facesPerVoxel] 
```

**Animation export:**

```
vrayCreateProxy -exportType {1|2} -dir $path -fname $filename -animOn -animType {0|1|2} -startFrame $startFrame -endFrame $endFrame -previewFaces $previewFaces [-createProxyNode -node $newNodeName] [-velocityOn -velocityIntervalStart $velocityIntervalStart -velocityIntervalEnd $velocityIntervalEnd] [-previewType $previewType]; 
```

> Macro (ui-text-box)
> 
> Note that $filename has to include the correct extension of the file, that is .abc or .vrmesh.


Import Mesh Example

.vrmesh example:

```
vrayCreateProxy -node $nodename -existing -dir $path.vrmesh -createProxyNode
```


alembic example:

```
vrayCreateProxy -node $nodename -existing -dir $path.abc -createProxyNode
```


This command creates a proxy node and points it to an existing file (.vrmesh or .abc). Please note that "$path.vrmesh/abc" is the full path of the file. $nodename is the name of the node in the Maya scene.


### Import/Export Material Rules Example

**Import material rules example:**

```
vrayImportProxyRules "pSphere_vrayproxy" "D:/Maya/Proxy/test.xml";
```


**Export material rules example:**

```
vrayExportProxyRules "pSphere_vrayproxy" "D:/Maya/Proxy/test.xml";
```


These commands are equivalent to the existing **Import/Export material rules** button (> Macro (inline-media-image)

), but allow for scripting.