This page provides a tutorial on using XGen Archive Primitives with V-Ray for Maya.
|
Select the geometry that you want to export.
Ensure that the name has no colons. For example, a mesh named Torso:torso1Shape will not export properly as an archive using XGen. Deleting the colon will fix the problem. Transforms should also not contain any colons. |
Ensure that the AbcExport maya plugin is loaded before exporting archives - XGen uses it. |
Choose Export Selection as Archive(s) from the XGen menu. For newer versions of Maya, this option can be found under the Generate menu.
|
In the dialog that opens, give the archive a name and export it
To download the scene created with these steps, please click the button below.
When an XGen archive export fails (no .xarc file is generated), find the <archive_name>.log file in the output directory of the export and check for errors. |
In this step, we will create a simple scene for the XGen Archive primitives.
Create a plane.
Assign a description with archives randomly across the surface.
Set the size of the archive to 50 and add the cookie_monster archive
A dialog will appear that asks you if the materials for the archives should be imported into the scene. Choose Yes.
Give the twist attribute the following expression:
rand(-180, 180) |
You should see something like this in the viewport:
More than one archive can be instanced in the same XGen description. Here is an example with a second archive:
You should see something like this in the viewport:
And when rendered it should look like this:
To download the scene created with these steps, please click the button below.
A material can be assigned to a patch/description and all archive instances can be forced to use that material
To make everything yellow we can assign a VRayMtl to the description and tick the Use Per Patch/Description Material For Archives option from the VRay settings in the Preview/Output tab:
There may not be a change in the viewport, but when rendered it should look like this:
Archive instances can be shaded uniquely through the use of Custom Shader Parameters
Unlike XGen Hair there are no specified/hardcoded names for such parameters - colors and floats with any name can be used with VRay User Color and VRay User Scalar and can be plugged to anything.
Here we will get rid of the tori archive and make each cookie monster body with a unique random color
Give User attribute name "body_color" as a value (or whatever name you like - It should just match the name of the parameter we will add later).
Add body_color as type color like this:
Go to the expression editor for the new attribute
Set the following expression
[rand(0,1), rand(0,1),rand(0,1)] |
And when rendered it should look like this:
You can also set this expression to the Primitive Color attribute of the Preview Settings in the Preview/Output tab to get some sort of visual feedback in the viewport
Add a custom shader parameter of type float like this
Set the expression of the new parameter to the following:
rand(0,1) |
And when rendered it should look like this (with every cookie having different reflectivity):
Here is another render with randomized refraction for the cookies instead of reflectivity
XGen can export an archive with animation within it from the export menu as shown below:
As an example here is the cookie monster with its eyes animated for 26 frames:
The whole archive instances can be animated uniquely as well - for more information refer to the XGen Animation and Motion Blur page.
The animation in the archive does not contain samples for non-integer times! If rendering with motion blur and more than 2 geometry samples for the scene the animated archives will have only 2 geometry samples. |
To make each archive instance be in a different frame of it's inner animation you can use XGen Frame attribute from the Primitives tab of the XGen window - you can put an expression like rand(0,10) or $frame.
You will also need to enable the Use XGen Frame Attribute Per Archive option from the Preview/Output tab of the XGen window.
|