---
title: "XGen Archive Primitives"
canonical: "https://documentation.chaos.com/space/VMAYA/111741681/XGen%20Archive%20Primitives"
format: markdown
---
This page provides a tutorial on using XGen Archive Primitives with V-Ray for Maya.

## **Overview**

---


## **Part I: Export an Archive**

---



---


## **Part II: Create a Simple Scene**

---

In this step, we will create a simple scene for the XGen Archive primitives.


###   
**Set up the Archive Primitives**

---



---



---



### **Set Up the Render**

You should see something like this in the viewport:


![image](media://7d701836-00f8-4982-b7f4-72d903ddc376)

 Add a [VRay Dome Light](https://docs-chaos.atlassian.net/wiki/spaces/VMAYA/pages/111740805) to the scene and render.   
  
The result should be like this:

![image](media://46ca704a-ee02-4c41-9a1d-6cf1db512a3d)


## **Part III: Adding Multiple Archives**

---



---



![image](media://b2176adf-5d75-42a7-8a85-286ff040be3b)


And when rendered it should look like this.

![image](media://83ddb5a1-b05a-4110-9287-042d96f96fb4)


To download the scene created with these steps, please click the button below.

> Macro (refined-button)




## **Part IV: Per Patch/Description Materials**

---



---


There may not be a change in the viewport, but when rendered it should look like this:

![image](media://700ae911-30f5-443c-9824-04606851fa66)

1. Projected textures can be used too! Here is an example with a projected file texture instead of the yellow diffuse color:

![image](media://c5ebd878-5ac0-4bfb-9808-ea6a6afe65a7)



## **Part V: Shading Archive Instances Uniquely**

---



### **Add a Custom Shader Parameter**

---



### **Randomize the Color with an Expression**

---


And when rendered it should look like this:

![image](media://9b0dac01-1ae1-442a-9530-56bfb022182e)


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 V-Ray User Scalar Map

---



And when rendered it should look like this (with every cookie having different reflectivity):

![image](media://18d5325c-6788-4fac-8d02-e347f499cde4)


### **Additional Options**

1. A texture map could be also used to drive the **Custom Shader Parameters** like explained in the [XGen General](https://docs-chaos.atlassian.net/wiki/spaces/VMAYA/pages/111741685) page
2. Here is another render with randomized refraction for the cookies instead of reflectivity


## **Part VI: Animated Archives**

---

XGen can export an archive with animation within it from the export menu as shown below:


![image](media://e3615327-761a-464d-a62e-2db26af5f137)

As an example here is the cookie monster with its eyes animated for 26 frames:


![image](media://e29f1c99-8fd4-4e97-8732-748e67006131)


The whole archive instances can be animated uniquely as well - for more information refer to the [XGen Animation and Motion Blur](https://docs-chaos.atlassian.net/wiki/spaces/VMAYA/pages/111741683) page.

> Macro (ui-text-box)
> 
> 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.

## **Part VII: Frame Attribute Per Archive**

---




## **Notes**

---

- Everything that can be done for XGen hair (animation, motion blur, batch mode, scene modifications, XGen attributes, IPR) can also be applied to XGen archives
- If an archive is exported with a material from the "initialShadingGroup", then it will not be imported by xgen into the scene when importing the archive.


** **