Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Overview

...

Section
Column
width62%55%

XGen is an Arbitrary Primitive Generator that instances primitives on polygon surfaces, allowing artists to create complex assets such as fur, feathers, grass, and so on. Instancing geometry is controlled through expressions, guides, direct placement, maps, etc. V-Ray can render two kinds of primitives from XGen: Splines and Archives.

The XGen features described here pertain to V-Ray 3.0 for Maya 2015 and newer. Support for Maya 2014.5 (called export to vrscene) is very limited (no animation/motion blur, no batch render support, etc.) and is a subset of the support for XGen in Maya 2015.

In order to use XGen in Maya, the XGen plug-in must first be enabled. 

UI Text Box
typenote
This information relates to rendering with V-Ray and not overall XGen usage and workflow.

For more information on using XGen with V-Ray for Maya, see the XGen Tutorials.

 

UI Expand
titleUI Path: ||Windows menu|| > Settings/Preferences > Plug-in Manager > xgen options

Image RemovedImage Added

Column
width5%

 

Column
width33%40%

Image Removed

...

Image Added

 

XGen in Maya Batch Mode

...

Section
Column
width62%55%

 To To render in batch mode, export the patches from all collections in the scene for batch render (to an alembic file) from the the XGen Window.

size
UI Text Box
mediumtypeinfo

When Motion Blur is enabled in the scene, you need to use the Export Patches for Batch Render option. Otherwise, the xGen geometry is not visible in the render.

Column
width5%

 

Column
width33%40%

Image RemovedImage Added

 

...

 

Section
Column
width62%55%

 The following dialog appears. If XGen primitives are animated, enable the Animated option, set the Frame Range, and click Export File. When the animation is of x frames from A to B, set the frame range in this dialog from A to B+1.

Whenever you change anything regarding an XGen collection/description (XGen attributes, modifiers or the original geometry) you will have to re-export the .abc file as shown above.

Please note the following about Alembic files exported for batch rendering:

Fancy Bullets
typecircle
  • If the animation contains non-integer keyframe times, they will be interpolated linearly between their respective floor and ceiling values. For example, for time 1.2 the sample will be interpolated linearly between 1.0 and 2.0. For 5.7, the interpolation will be between 5.0 and 6.0.
  • The results might differ slightly from renders in Maya Interactive Mode without the use of an Alembic file when the interpolation in the scene is not linear (which is true by default; see Windows menu > Animation Editors > Graph Editor).
Column
width5%

 

Column
33%
width40%

Image Added 

Image Removed 

 

Parallel Export

...

Section
Column
width55%
The Enable parallel option lets an XGen description to be generated using all CPU threads.
Column
width5%

Column
width40%

Image Added

Caching XGen Primitives to a .vrscene

...

 

Section
Column
width55%

XGen primitives (splines/archives) can be cached to a .vrscene so that consecutive renders of the same unmodified primitives take less time to export. This is most useful for large amounts of primitives with complex XGen expressions/guides on a complex source geometry, when the export time becomes minutes rather than seconds. The vrscene cache can also be used with the new vrscene node from the V-Ray section of

...

Column
width62%

the Create menu.

UI Text Box
typeinfo
This feature is not the same as the Maya 2014.5+ XGen support through vrscenes, which is now deprecated.

The options for vrscene caching are located in the VRay Settings section of the Preview/Output tab of the XGen window.

Section
columnwidth

 

Use vrscene cache – Enable this option to use a previously exported vrscene cache when rendering.

Export material for hair – By default, only the geometry gets cached, allowing you to change the hair material without having to re-export the XGen geometry. Enable this option to export the material for hair so the resulting vrscene cache can be usable with the vrscene node.

vrscene cache file – Sets the file to export or use.

Export vrscene cache – Exports the cache to the specified file.

To export a cache, give a path to a .vrscene file and click the Export vrscene cache button. Then to use the cache, enable the Use vrscene cache option and do a normal render.

width5%

 

Column

33%

Image Removed 

 

Note the following about vrscene cache:

Fancy Bullets
typecircle
  • Caches are per-description and not per-patch.
  • When caching archives, everything gets cached including materials, textures, bitmaps and geometry. If anything is changed, the cach must be re-exported.
  • Note that with V-Ray 3.60.03 a single .vrscene file is generated for the purpose of simplifying the workflow.
  • When exporting hair to the vrscene cache, the hair will not yet be tessellated. Tessellation happens just before rendering by V-Ray so the cache stays small.
  • The export of the cache will take into consideration the current animation and motion blur settings.
  • If you are rendering a layer different from the default one and using a vrscene cache, the cache must have been exported from that layer (the layer name is appended to the vrscene filename by V-Ray automatically).
  • For render managers: the .vrscene file should probably be put on a network location accessible by everyone so only one machine does the export before starting the render manager.
Column
width5%

 

Column
width40%

Image Added 

 

Scripting the Caching Operation with Python

...

Code Block
languagepy
from vray.xgen import *
# export the cache
exportXGenDescriptionToVrscene("description4", "collection4", "C:/my.vrscene")
# prepare for using the cache
setUseVRSceneCacheForXGenDescription("description4", "collection4", 1)
setVRSceneCacheForXGenDescription("description4", "collection4", "C:/my.vrscene")
# render
import maya.mel as mel
mel.eval("vrend -camera persp -layer defaultRenderLayer")

...

Tessellation Parameters

...

Section
Column
width62%55%

V-Ray has options for the tessellation of XGen splines.

Go to the the Preview/Output tab, and from the Output Settings choose V-Ray as the the Renderer. Find the V-Ray Settings in the Preview/Output tab.

The Hair Tessellation Mode and the slider below it can be used to tweak the tessellation and thus improve rendering speed, memory footprint and quality.

Column
width5%

 

Column
width33%40%

Image RemovedImage Added

 

 

 

Per Spline Mapping

...