Adding xgen hair/fur manually

Atoms supports static xgen collections for Renderman and Arnold.

In this section it's explained how you can manually export geo with fur and set up your variations. This will be handled automatically if you use the Variation Builder.

Exporting xgen collection and meshes

Open the man.ma (you can find this scene inside the data folder of your Atoms installation) scene and create a simple xgen groom, something like in the picture. Then you can start to export the data needed by atoms.

First you should export the meshes. Please remember to export them after you created an xgen groom, this is because xgen adds a xgen_Pref attribute on the mesh that the Renderman procedural uses during the rendering. Export the meshes with the atoms mesh exporter (Atoms menu: Atoms > Export > Mesh exporter) or using the variation builder.

Now you can export the collection. Select the xgen collection and select from the Atoms menu: Atoms > Export > Xgen Collection Exporter.

Select the head mesh and inside the ui press the geo field select button. Choose an output folder, set an output name in the last field and press export.

The tool saves a copy of the current collection in the output folder, it renames the collection using the output name and it exports all the materials attached to the descriptions. It creates also a .groom file, this is an atoms file that you will use later to setup the agent variation.

If you want check the content of the .groom file, open it with python. It's an Atoms MapMetadata.




Setup the atoms scene
  • Create an agent group
  • Add a grid layout module and set the grid size to 3,1,3
  • Add a state machine module and set the state to 1
  • Add a variation module and set the variation name to variation1

Now from the Atoms menu: Atoms > Variations > Import variation json, import the json variation file we exported previously.

Open the Agents Variation Manager from the Atoms menu: Atoms > Variations > Agents Variation Manager.

Select the man from the column on the left. Inside the geometry tab add a new entry press the right mouse button. Set "hair" as key and set the path of the .groom file you exported. Change the body_GEO path with the mesh we exported at the beginning of this tutorial.

Go inside the GeometryGroup tab. Select the variation1 variation and add a new entry pressing the right mouse button on the table on the right. On the first field select hair and on the second one select one material. The material you select doesn't influence the hair material because at render time it always use the ones contained inside the collection folder. Press ctrl+s or from the File menu choose "register to atoms" to save the changes.



Exporting caches

The xgen fur can be renderer only using the atoms proxy node.

First let's export an alembic cache, we need that because the xgen procedural can read only the mesh animation from an alembic cache.

Open the alembic exporter from the Atoms menu: Atoms > Export > Alembic exporter. Inside the ui select first the agent group at the top and then select all the agent on the bottom widget. Select Variations from the mesh mode menu and turn on the "Groom Cache" option. Select an output file and finally press "Run".

Now let's exoport an atoms cache using the Cache exporter from the Atoms menu:

Atoms > Export > Cache exporter.

Select the agent group from the list on the left and press on the arrow button. Provide a file path and select "Replace with Atoms Proxy" for the "After export" field.

Click export.




The Atoms Proxy

You should have a proxy in the scene with the cache path already configured.

Set the draw mode to variation.

Finally in the "Atoms Groom Cache File Path" click on the "..." button and browse to the folder where you exported the groom. Select one of the groom files.


Rendering

Renderman: Create some renderman lights and select from the Atoms menu: Atoms > Scene > Setup xgen settings. This will add a mel script to the renderman post world ri injection scripts. This script sets up the xgen camera attributes at each frame.

Arnold: Create an Arnold light.

Start your render.

Copyright © 2017, Toolchefs LTD.