Hi,
Here is a little python script to export paint effects hair (or any paint effects stroke for that matter) to and alembic file for import into the standalone, it will work for Maya hair and nHair also.
Installation:
Unzip the attached file and place PFXtoAlembic.py into your Maya scripts directory eg. C:\Users\User1\Documents\maya\2014-x64\scripts
Usage:
To run the script open the script editor and copy and paste the following two lines into an empty python tab.
import PFXtoAlembic
PFXtoAlembic.PFXconvert()
Select these and middle mouse drag the lines to a shelf to create a shelf button to run the script, clicking it will open an options dialogue.
The options in the dialogue are as follows:
Frame Range: - Pretty obvious, the first and last frame of the animation. They will default to the current time slider range. (I haven't built in a pre-roll yet so if there are dynamics involved you should always export from before or at the dynamics start frame.)
Curve Width: - The thickness you want the curves to render. The default is 0.01 and seems like a good starting point. I haven't managed to get tapered width working yet.
Output File: - The filename and location for the .abc file that will be written out. There is a browse button beside it to open the file dialogue.
Once you have your options set select the top node that contains the hair or Paint Effects strokes below it, if you are exporting many separate PFX strokes then make sure you have grouped them all under one group node first. Then click the Export button.
Notes and Limitations:
You should export your hair separately using this script and then your geometry using whatever alembic export you like and then bring them together in the standalone using a geometry group as for now it seems this is the only way to get a separate material pin for the hair object.
The script will rename your scene and save it with the suffix "_curveExport". This protects your original scene from any crashes or changes. The new scene will have the display percent attribute on the original strokes set to 0 and will contain the curves that were exported.
During the export the scene saves twice so if it is a large scene that takes a while to save it will take longer to execute.
Depending on the number of curves being generated it may take a while for the 'convert to curves' to happen before the alembic is exported, just be patient.
I haven't put any error checking into this script so if you try to click Export without anything selected it will give an error and not run.
You can only export one hair system at a time or more correctly one group of strokes at a time and these will come into the standalone as one mesh with all hairs in that mesh sharing the same width factor. If you have more than one node selected when clicking Export it will have unpredictable results as again I have not done any error checking for this at this stage.
If you need to export more than one hair system go back to the original scene, select the top node of the next hair system or group of strokes and re-run the script, remembering to give the .abc file a new name.
I may not advance this script beyond this point as it was mainly so I could test some full hair systems in v2.0 and to force myself to get coding again and start to learn python. I figure once the Maya plugin for v2.0 is done I won't need this.
Although the script may work in older versions you should be running Maya 2014 service pack 1 or later as the script exports Ogawa format alembics because Octane prefers these and earlier versions of Maya can't export these.
T.
https://vimeo.com/93686326