Page 1 of 2

Xgen hair in Clarisse

Unread postPosted: Tue Aug 20, 2019 12:01 pm
by dane
We've picked up an asset thats been done in maya and used xgen for the fur system, it has guide curves to groom the hair.

I'm wondering if I can export those guide curves and use them along with the interpolate node to guide my fur system in Clarisse?

What are the general steps in doing something like this? I've seen this: but I dont know how to get an 'geometryABCFur' out of maya. I've tried exporting the curves as alembic and they seem to be recognised in clarrise as they come in correctly and display with thickness but I cant seem to use them in any way in the interpolate node.

Any tips or guides would be much appreciated.

Best, Dan

Re: Xgen hair in Clarisse

Unread postPosted: Tue Aug 20, 2019 1:38 pm
by gdoublet
Hey Dan,

To export Guides from Xgen to Clarisse you need to first export your curves as .mel from xgen (Output Settings>Operation>Create MEL File), then import the .mel file in maya, you will see that all the curves are inside a group, select the group and create a new attribute "riCurves" Boolean, check the "riCurves" attribute in the Extra Attributes of the group, and now you just have to export the group as alembic.
That's it you got the geometryABCFur and you can use it in Clarisse.
Let me know if that works.



Re: Xgen hair in Clarisse

Unread postPosted: Tue Aug 20, 2019 3:00 pm
by dane
Perfect! Thanks for that, exactly what I wanted

Re: Xgen hair in Clarisse

Unread postPosted: Tue Aug 20, 2019 5:08 pm
by esmith
Hello Dane, I have some scripts and stuff that help you get this all done. I've got it in an e-mail for a client describing what i think is the easiest way, with some test content and stuff. Give me a few hours and I'll have this all uploaded for you. Exporting as MEL is a new way for me, so I want to see if it's quicker than my current method in terms of "steps".

Stay tuned...I'm starting this now......

Re: Xgen hair in Clarisse

Unread postPosted: Tue Aug 20, 2019 5:39 pm
by dane
Legend! That would be great to test out, much appreciated esmith!

Re: Xgen hair in Clarisse

Unread postPosted: Tue Aug 20, 2019 8:19 pm
by esmith
Ok here we go. Here is the description of the process and some MEL scrips and icons for a Maya shelf to help speed it up. I couldn't get the MEL export to work, it doesn't seem to allow for the population of 2 attributes that are required, so I've reverted to the way I know it works, and it's pretty simple. I did mine from scratch just now to make sure each step works.


So here I've got my 2 geos in Maya, specifically we have our scalp geo on which to place Xgen curves

This is the type of groom I made, Groomable Splines
Capture1.PNG (62.54 KiB) Viewed 2975 times

You can see here the horrendous haircut I gave our PolyModel and our associated "collection" description.
Lets bring this into Clarisse

Now select the "Generate" top menu in Maya, and with the Description selected in the Outliner, select "convert to interactive groom"
A requester will come up, you can leave it blank, I did, and just hit convert.

That process will generate a new asset in your outliner
Capture4.PNG (7.86 KiB) Viewed 2975 times

With that new asset selected run the following script
Here is the Icon I made for my custom Maya shelf
XGenInteractiveGroomDescription_Export_Alembic.png (3.72 KiB) Viewed 2975 times

string $array[] = `ls -sl`;
for ($item in $array)
xgmSplineCacheExportCmd -export;

This will bring up the export dialog, make sure MULTIPLE TRANSFORM and WRITE FINAL WIDTH are turned on
(this is what was missing in the MEL export, and it is required as far as I can tell)

That process generates an asset that you will then import back into Maya via "Cache / Alembic Cache / Import Alembic"
Capture6.PNG (15.35 KiB) Viewed 2975 times

Here you can see the export, simply select it and hit Import

This asset will now appear in the Outliner, it's a group with a BUNCH of curves representing one for each guide.
Reduce guide density to reduce curve density
To make this new asset usable we need to run the following script on it in order to add the proper RiCurves attribute
Again here is an icon for your Maya shelf.
CombineGuideCurves_AddATTR_Export_Alembic.png (4.11 KiB) Viewed 2975 times

string $array[] = `ls -sl`;
for ($item in $array)
addAttr -ln "riCurves" -at bool -dv 1;



Now save this new Alembic, it's the one we will use in Clarisse as a base for interpolation

Now in Clarisse, we have the same scalp geo, and I am using it as a geometry base on which
to scatter 100,000 points. The rough amount of human hairs on a human head.

using File / Reference / File to import the RiCurves combined curve asset we just exported from Maya

And now you you can see our curves in Clarisse ready to be used as guides in the interpolate node

Create an Interpolate node, using the Point Cloud as Geometry Support, and using the imported Curve Alembic as the Guides

And then you can see 100,000 hairs, ready for shading in Clarisse.

In the compressed file you will find Maya scenes to see my Xgen hair setup, a Clarisse PLE scene so anyone can look at the Clarisse setup and finally of course all the assets used above in terms of import export. Perhaps there is a way to combine some of the processes, but as of today I can't currently. :-) Hope this helps!

Re: Xgen hair in Clarisse

Unread postPosted: Wed Aug 21, 2019 5:06 pm
by dane
Thanks for the detailed breakdown mate! Very handy, to have, I'm on something else for the rest of the week but when I'm back on this I'll update if we write any extra scripts or discover anything else useful for the community :-)

Thanks again man!

Re: Xgen hair in Clarisse

Unread postPosted: Wed Aug 21, 2019 6:10 pm
by esmith
excellent, keep us posted and good luck Dane!

Re: Xgen hair in Clarisse

Unread postPosted: Thu Aug 29, 2019 2:13 pm
by dboude
This is an answer to a deleted post...


Here is an example to explain how layering works. Consider you have two alembics containing the same objects. The objects in both alembics share some properties like vertice positions and a custom one. Objects in alembic A have UV properties where objects in alembic B don't. And objects in alembic B have color properties where objects in A don't. Let's layer those two alembics. The resulting objects will have the position of the B file (B overrides A), the UV of the A file, the color of the B file and the custom of the B file (B overrides A). ---> the last ABC in the list overrides the others.


I guess you want to export a static groom/curve set and then add another alembic to drive the position and rotation of each strand depending on the deformation of the support? This is not possible.

Otherwise, layering alembic files containing curves works. Just tested with static curves having color and animated ones without color. Result = animated colored curves.

Cheers ;)

Re: Xgen hair in Clarisse

Unread postPosted: Thu Aug 29, 2019 2:31 pm
by dupevfx
Thanks Demian, I deleted the post as I was on the wrong account but I got distracted and forgot to repost it..

Thanks for the explanation though, I imagined this is what was happening but thought I'd check.

Cheers! :-)