XGen Guidelines for Hair Creation

Describes guidelines for exporting grooms as Alembic files for use with Unreal Engine 4.


This guide will show you how to setup a groom in Maya's legacy XGen hair creation system for importing into Unreal Engine with a set of supported attributes outlined in the Alembic for Grooms Specification documentation.

Maya 2018.6 was used in creation of assets for this guide.

Converting Legacy XGen Description

Guides to NURBS Curves

  1. Set Maya's menu set to Modeling so that you see the correct menu options available.


  2. From the main menus, click the Generate dropdown and select XGen Editor.

  3. In the XGen window, use the Utilities tab to select Guides to Curves.


  4. Click Create Curves.

Once completed, your groom's output should look similar to this:


Groom to XGen Interactive Groom

If you're using legacy XGen Description, the groom will need to be converted to be an XGen Interactive Groom. You can do this by:

  1. Select the XGen Description nodes.


  2. While in the Modeling menu set, use the main menu to click the Generate dropdown, then select Convert to Interactive Groom.


Spline Descriptions to NURBS Curves

  1. Select the XGen Spline Description nodes.

  2. While in the Modeling menu set, use the main menus to click the Generate dropdown. Then, select Cache > Export Cache.


  3. In the Export Cache window, set the following:


    • Cache Time Frame: Set to Current Frame

    • Multiple Transforms: Disabled

    • Write Final Width: Enabled

  4. Give the file a name and select Alembic as the file type.


  5. Click Export.

  6. Then, use the File menu, and select Import to open the Import window and bring the Alembic (.abc) file into your scene.


Once you have completed this process, you now have an XGen Spline Description that has been exported as an Alembic file and imported to bring the interpolated hairs in as NURBS curves.


Creating Attributes

Create Group ID Attributes

Interpolated hair can be exported in one or more groups. These groups are recognized in Unreal Engine for unique material assignment.

Use the following script when creating group ID attributes:

from maya import cmds

attr_name = 'groom_group_id'

# NOTE: change the following names to reflect your node's scene.
groups = ['hair_brows_splineDescription1|SplineGrp0', 'hair_lashes_splineDescription1|SplineGrp0', 'hair_head_splineDescription1|SplineGrp0']

for groom_group_id, group_name in enumerate(groups):

    # get curves under xgGroom
    curves = cmds.listRelatives(group_name, ad=True, type='nurbsCurve')

    # tag group with group id
    cmds.addAttr(group_name, longName=attr_name, attributeType='short', defaultValue=groom_group_id, keyable=True)

    # add attribute scope
    # forces Maya's alembic to export data as GeometryScope::kConstantScope
    cmds.addAttr(group_name, longName='{}_AbcGeomScope'.format(attr_name), dataType='string', keyable=True)
    cmds.setAttr('{}.{}_AbcGeomScope'.format(group_name, attr_name), 'con', type='string')

Create Guide Attributes

When creating the guide attributes for your groom, only the curves tagged as "guide" are used for simulation in Unreal Engine. If there are no guides specified in the Alembic file, a percentage of the interpolated hairs will be internally tagged as guides during the import process into UE4.

When importing a groom with no guides, the percentage of interpolated hairs that are tagged as guides can be set using the Groom Import Options . By default, only 10% of the number of hairs will be used as guides.

Use the following script when creating your guide attributes:

from maya import cmds

attr_name = 'groom_guide'

# get curves under xgGroom
curves = cmds.listRelatives('xgGroom', ad=True, type='nurbsCurve')

# create new group
guides_group = cmds.createNode('transform', name='guides')

# tag group as groom_guide
cmds.addAttr(guides_group, longName=attr_name, attributeType='short', defaultValue=1, keyable=True)

# forces Maya's alembic to export curves as one group.
cmds.addAttr(guides_group, longName='riCurves', attributeType='bool', defaultValue=1, keyable=True)

# add attribute scope
# forces Maya's alembic to export data as GeometryScope::kConstantScope
cmds.addAttr(guides_group, longName='{}_AbcGeomScope'.format(attr_name), dataType='string', keyable=True)
cmds.setAttr('{}.{}_AbcGeomScope'.format(guides_group, attr_name), 'con', type='string')

# parent curves under guides group
for curve in curves:
    cmds.parent(curve, guides_group, shape=True, relative=True)

Export to Alembic from Maya

  1. Select the Guides and Group_ID curves in Maya that you want to export.

    Each node needs to have a unique name.

  2. While in the Modeling menu set, use the main menus to click the Cache dropdown, then select Alembic Cache > Export Selection to Alembic.


  3. In the Export Selection window, under the General Options category, set the Cache time range to Current Frame.


  4. Under the Attributes category, type the name of the Attribute you want to the list and click the Add button. Add the following schema attributes:


    • groom_group_id

    • groom_guide

  5. Give the file a name in the File name textbox and set the Files of type to Alembic.


  6. Click the Export Selection button.

Select Skin

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback