Versions Compared

Key

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

...

This page covers the basics of using XGen with V-Ray for Maya, including a step-by-step guide to controlling XGen Attributes through texture maps.


Prerequisites

...

Section
Column
width55%
Make sure xgenVRay.py

...

 is loaded as a plugin into Maya (Plug-in Manager - near xgenToolkit.mll) before creating scenes or rendering

...

Column
width5%

 

...

Column
width40%

Image Added 

 

...

 

Section
Column
width55%

When rendering XGen descriptions with V-Ray, make sure

...

the Output Settings

...

 in the Preview/Output

...

 tab of the XGen window are as follows:

...

Operation

...

is set to Render

...

and Renderer

...

is set to VRay.

 

UI Text Box
typenote

If VRay is not in the Output Settings as shown above, try restarting Maya (with xgenVRay.py as "Auto load" in the Plug-in manager).

To ensure that V-Ray is there, always start Maya 2015+ normally, check in the Plug-In Manager that the module xgenVRay.py is loaded, and then load/create XGen scenes. Opening scenes by double-clicking on the file will not ensure that V-Ray is registered in the XGen UI

Column
width5%

 

Column
width40%

Image Added

Basics

...

Section
Column
width55%
V-Ray can render two kinds of primitives that XGen has to offer - Splines and Archives. Spheres and Cards primitives are not yet supported
Column
width5%

 

Column
width40%

Image Added

 :Image Removed

...

 

The following images below show how instanced primitives look when the base mesh has a low versus a high subdivision; note . Note how XGen clumps primitives more to the center of each face. This is the same behavior for all kinds of primitives.

 

Section
Column
width10%

 

Column
width40%

Low Subdivision

Column
width40%

High Subdivision

Column
width10%

 

...

Part I: Through Expressions

...

Section
Column
width55%

Here we demonstrate how expressions may be used to control XGen attributes:

  1. Click on

...

  1. the Sigma

...

  1.  button of an attribute. In this example, we

...

  1. control

...

  1. the Length attribute.
Column
width5%

 

Column
width40%

Image Added

 

...

 

Section
Column
width55%
 2.

...

Edit the expression in the lower text-box of the popup.

...

Click Accept

...

 to use it. In this example, we will introduce randomization to the Length.
Column
width

...

5%

 

Column
width40%

Image Added

 

Part II: Through Texture Maps

...

  1. Create a plane and create an XGen description on it, with splines randomly across the surface.
     
  2. Increase the Density from the Primitives tab of the XGen window to 50.

...



...

Set Up the Map

Section
Column
width55%
1. Click on the arrow pointing down next to

...

the Sigma

...

 button of

...

the Length

...

 attribute and

...

select Create Map.

...

Column
width5%

 

Column
width40%

Image Added

 

...

 

Section
Column
width55%

...

A pop-up window appears

...

.

...

2. Increase

...

the Map Resolution

...

 to about 200. This is the resolution of the PTex map in texels per-face. Use larger values for high resolution textures.

...

Name the map as you wish, and

...

click Create.

Column
width5%

 

Column
width40%

Image Added

 

...

 

Section
Column
width55%

Paint or Connect an Image

  1. After creating the map, you will be in PTex painting mode. You can paint on the surface of the plane with the 3D Paint tool.

...

  1. If you wish to use an image file, open

...

  1. the Hypershade

...

  1.  and Node Editor

...

  1.  and click on the icon circled below next to

...

Image Removed
 

  1. the Length attribute.
Column
width5%

 

Column
width40%

Image Added

 

...

 

Section
Column
width55%

3. You should see a file texture connected to the plane, shown

...

Image Removed
 
 

here.

4. Select the file texture and load the texture map that you wish to use to drive the length of the primitives. Texture maps with higher contrast work better for controlling attributes.

Column
width5%

 

Column
width40%

Image Added

 

...

 

Section
Column
width55%

Save the Texture

  1. When you are done painting/selecting a texture, click on

...

  1. the Save

...

  1.  icon next to the attribute. Always remember to save after changing a texture map, Otherwise XGen will not refresh, and the changes will not be visible in the viewport or renders.

...

...

  1. Using a bitmap like the one shown below left should correspond to a view in the viewport like the shown below right

...

  1. .

Column
width5%

 

Column
width40%

Image Added

 

...

 

Section
Column
width10%

 

Column
width40%

Bitmap

 

Column
width40%

Result in viewport

 

Column
width10%

 

...