VRayProxy allows you to import geometry from an external mesh at render time only. The geometry is not present in the Rhino scene and does not take any resources. This allows the rendering of scenes with many millions of triangles - more than Rhino itself can handle.
Before you can import a mesh through a VRayProxy object, you need to create the mesh file first. You can do this in two ways:
- Through the main V-Ray toolbar: select the meshes you want to export, right-click on the V-Ray Proxy icon Mesh Export dialog to appear. . This will cause the
Dialog from the Rhino command line: select the geometry that you want to export and then type.
- You will first be prompted for a file name an then the Mesh Export dialog will appear.
The Mesh Export Dialog
The Mesh Export dialog allows you to specify the mesh file as well as some export options.
File - this is the file name and folder for the mesh file(s).
Export all selected objects as single mesh file - this option will take all selected objects and will merge them into one mesh file. This option also stores the transformations of the selected objects. When you import the file with a proxy object, it must be centered at the origin, if you want the objects to be in the same place. Also, since the imported mesh is rendered using the material of the proxy object, all meshes from the file will render with that material. You must use sub-object materials and different material IDs if you want them to have different materials.
Export each selected object in a separate file (non-recursive) - this option will create one file for each selected object. The name of each file is derived from the name of the corresponding 3ds max node. The transformation of an object is not included in its mesh file, and the corresponding proxy must have the same transformation as the original object, if it is to appear in the same place. Note that you can use this option even with a single object, which will cause the object pivot to be preserved in the exported .vrmesh file.
Automatically create proxies - this option will create proxy objects for the exported meshes. The proxies will have the correct transformations and materials derived from the original objects. The original objects will be deleted.
Warn for existing files - when this option is selected V-Ray will warn you if you are saving over an existing file
Set triangle count for preview mesh - allows you specify how many faces are going to be used to show a preview of the proxy in the view port.
Pressing the OK button will create the mesh files and the proxy objects. The export process may take some time, depending on the amount of geometry that must be processed.
Importing a Mesh from a File
Once you have exported a mesh to a VRayProxy you can import the mesh back at any time. There are two ways you can import a mesh back from a VRayProxy object:
- Through the main V-Ray toolbar: left-click on the V-Ray Proxy icon . This will open the Choose a VRMesh file window to appear. Select your file and the mesh will appear in the scene
The .vrmesh File Format
Meshes are exported to a special .vrmesh file format. It contains all geometric information for a mesh - vertices and face topology as well as texture channels, face material IDs, smoothing groups, normals - in short, everything that is needed to render the mesh. In addition, the mesh is preprocessed and subdivided into chunks for easier access. The file also contains a simplified version of the mesh used for preview purposes in the viewports. Also, there is an option for adding a point cloud data to the file which is a simplified geometric representation of the mesh in the form of 3D disks with different levels of detail. Each level comprises disks with equal radius which is greater for levels of lower detail and smaller for the more detailed ones. When the object is rendered a point cloud geometry level is chosen depending on the distance between the object and the camera - for distant objects lower resolution point clouds are used. Thus original mesh is replaced by the simpler point cloud geometry with the appropriate level of detail allowed by distance.
It is important to realize that the mesh is in a "ready to render" format. No further modifications to the mesh are expected. You can't apply modifiers to the mesh, or animate it in any way except if you animate the position/orientation of the proxy object.
After you export a mesh to a .vrmesh file, you need a proxy object to represent it in the Rhino scene. To create a proxy object click the VRayProxy button from the main V-Ray toolbar. A dialog box will appear that allows you to choose the .vrmesh file to import. Finally, click in a viewport to create the actual proxy object.
- If you need to create several proxies linked to the same .vrmesh file, it's better to make them blocks - this will save memory since the .vrmesh file will be loaded only once.
- The resulting .vrmesh files can be rendered outside of Rhino - for example, by V-Ray for 3ds Max, V-Ray for Maya, V-Ray for Softimage and in the standalone version of V-Ray.