The following steps go through the process of rendering a head model (kindly provided by Lee Perry Smith) as an XGen archive.
- Open the head scene file. You will need to assign a Standard Surface shader to it and connect the relevant texture maps to it.
- Before you export the mesh as an archive, you must first save the scene, otherwise XGen will fail to export it.
Select the head mesh and go to Generate>Export Selection as Archive(s)... (alternatively you can convert a saved scene to an archive using Create from Selection... under Archive Files once the description has been created).
- The Export Selection as Archive(s) window should appear. Change the Archive Name to Head.
- Select a folder where you want XGen to save the archive file and select Export. XGen will then export the model as an archive file within the selected folder.
When exporting geometry as an archive, ensure that the name has no colons. For example, a mesh named
Head:Group3919Shape will not export properly as an archive using XGen. Deleting the colon will fix the problem.
You should see the Export Selection as Archive(0) Progress window when XGen is exporting the mesh:
- The next stage is to create a new scene with which we can render the head model as an XGen archive.
- Create a polygon plane. We will add the XGen description to the plane and it will also double up as a floor plane. Select the polygon plane and select XGen>Create Description. The XGen window should appear. Click on Create New Description....
If the archive has not exported correctly, check that the MtoA Render Settings are loaded prior to exporting.
- The Create XGen Despcription window will appear. Change the New Description Name to Heads.
- Choose Custom Geometry/Archives (use for any model you have created) as indicated in the image below:
- The XGen window should replace the attribute editor. Before opening the archive file, reduce the Percent value to a low value in the Preview Settings (Preview/Output tab). This is a good habit to get into as XGen could automatically create many instances in the viewport, depending on settings such as the Density. If the percentage is too high it can cause Maya to crash without any prior warning.
Lower the Preview/Output Percent
- Go back to the Primitives tab. Scroll down to Archive Files and select Add.
- Go to the location where you saved the XGen archive file and select it. It should be called something like Head-model.xarc
- You will be prompted with the following window. Select Yes to import the materials that were saved with the archive file (you can change the material assignment later if you wish to do so).
Import head material into scene
Increasing the Density will increase the number of primitives.
- To view the XGen archive model in the viewport, slowly increase the Percent value in the Preview Settings. If you cannot see the head model, you may have to adjust the Size value (underneath the Add... button in Archive Files).
- XGen has placed the heads randomly across the surface because this is the default option when creating a description. If you want the primitives to be placed in rows and columns, you can do so by selecting In uniform rows and columns in the Generate Primitives menu under Generator Attributes (Primitives tab).
- When Generate Primitives is set to In uniform rows and columns the Spacing attribute replaces Density. Increasing the Spacing attribute increases the distance between the primitives.
- If we save a log file we can view the total number of unique objects and polys within the scene (increase the Max. Warnings to 6 ). For example, if we look at the log file for the render below, we can see that it contains 378001 head objects and a total of 71725596842 visible triangles.
378001 head objects (71725596842 visible triangles) rendered with XGen
Thanks to James Busby for the use of his head model scans.