Exporting Hair to Alembic 


Exporting Ornatrix Maya hair to Alembic video tutorial

Ornatrix provides a special translator which allows writing one or more hair objects into an Alembic file. The resulting .abc files can be imported in a myriad of CG software which supports Alembic. They can also be used with V-Ray Proxy objects to quickly load and render the resulting hairs anywhere V-Ray is used. There are options to export single frame or an animation range as well as viewport or render representation of the hair.

 

Exporting hair to Alembic 

To export a hair object to Alembic file:
  1. Select the Ornatrix hair object which you want to export
  2. Go to Main Menu -> File -> Export Selection...
  3. In Export Selection dialog select Ornatrix Alembic file type in the Files of type list at the bottom (you may need to scroll down)
  4. Type in the desired name of your .abc file and press Export Selection
 

Parameters 

  • Format
    The algorithm used to encode the Alembic file. Currently there are two options: Ogawa and HDF5. Ogawa tends to give better compression rates and robustness.
  • Start Time
    The first frame of the scene to be exported
  • End Time
    The last frame of the scene to be exported. If this value is same as Start Time then static hair is exported at specified time. Otherwise an animation is exported.
  • Step
    When exporting animated hair this specifies how many frames to skip between each sample. Value of 1 means that every frame will be sampled.
  • Use Render Version
    When on, hair in the scene will be switched to render mode and dense hair strands will be exported. Otherwise, what is seen in the viewport will be exported.
  • Up Direction
    Allows specifying the direction which points up in the saved Alembic file. This is needed when exporting hair to other hosts. For example, in 3dsmax Z axis points up but in Maya Y axis points up.
    When velocity export is used specifies the length, in frames, of time interval used to calculate the velocity vectors
  • Use World Coordinates
    When on, hair will take its shape's transform into account when writing its position data. For example, if there are multiple hair objects their relative positions to each other will be preserved. Otherwise, hair will be exported in its local object space, placing it at the origin.
  • One Object per File
    When on, separate Alembic files are written for each of the objects being exported. Object's name will be appended to the file name.
  • Unreal Engine 4 Export
    When on, the resulting Alembic file will be formatted to be compatible with groom import in Unreal Engine 4
 

Exported Components 

These are different aspects of hair which can be selectively exported or ignored:

  • Export Velocities
    When on, a velocity vector will be written for each hair vertex. This is needed if you're exporting per-frame .abc files and want to have motion blur working when rendering it out.
    • Velocity Interval Center
      When velocity export is used specifies the offset from current frame which will be the center of the interval used to compute the velocity vectors
    • Velocity Interval Length
      When velocity export is used specifies the time length around the interval center parameter used to calculate the velocity vectors
  • Export Strand Data
    When on, any per-strand and per-vertex data which exists in hair will be written to the Alembic file. This data can be created with Edit Guides operator or Generate Strand Data operator, for example.
  • Export Texture Coordinates
    When on, all texture coordinates channels present in hair will be written to the Alembic file
  • Export Widths
    When on, the strand width/thickness information will be preserved into the Alembic file
  • Export Strand Ids
    When on, unique strand ids will be written to the Alembic file. This is useful if you want to ensure that applying operators after importing the hair back will provide consistent results since strand ids are often used to set random values by some operators.
  • Export Strand Groups
    When on, per-strand group values are written to the Alembic file
 

Exported Data Format 

Ornatrix hair or guide strands are written to an Alembic file as curves. Information such as width, velocities, and texture coordinates is included in the description of said curves. Additional information which is Ornatrix-specific is attached to either individual vertices or individual curve primitives within Alembic file the following way:
  • Strand ids are written as per-curve geometric attributes with name strandId
  • Strand groups are written as per-curve geometric attributes with name strandGroup
  • Per-vertex channel data is written as floating point per-vertex geometric attributes with name chan_ followed by the channel's name
  • Per-strand channel data is written as floating point per-curve geometric attributes with name chan_ followed by the channel's name
 

Technical Specs 

  • Ornatrix uses Alembic library version 1.7.3
  • Curves are exported using B-Spline Basis, they are non-periodic and linear
 

What is exported 

The following information about the hair strands is being exported, if it is present. If importing hair back it will be preserved:
  • Strand positions and animation
  • Per-vertex widths
  • Texture (UV) coordinates
  • Per-vertex channel names and data
  • Per-vertex velocities (optionally, off by default)
 

To import the Alembic hair with V-Ray Proxy 

After exporting Ornatrix hair using the steps above you can import these hairs using V-Ray proxy:
  1. Activate the VRay shelf (you may first need to load the vrayformaya.mll plugin in the Plugin Manager)
  2. Click on the Import VRay proxy button, second from the left
  3. In the File(s) box click the folder icon to browse. Select your exported .abc file
  4. The hair should now be imported and appear within the viewport
 

Using MEL to export hair to Alembic 

In addition to exporting hair to Alembic through the UI you can also do it through scripting using MEL. The following command will export a hair object to Alembic file:

void OxAlembicExport( string $fileName, string[] $hairObjectNames );
/* Flags:
-ft From time
-tt To time
-s Step
-f If present, specifies type of export format: 0 - HDF5, 1 - Ogawa
-r If present, render versions of the hair will be used
-o If present, all coordinates will be exported in object space instead of world space
-up If present, specifies the direction of the output's up axis (0-X, 1-Y, 2-Z)
-v If present, per-vertex velocities will be written
-vic If present, specified velocity interval center in frames (default is 0.0)
-vil If present, specified velocity interval length in frames (default is 0.5)
*/
Missing Something? Let us know if this page needs more information about the topic.