Isotropix Forums

Xgen hair in Clarisse

General Discussion about Isotropix and CG related topics

Xgen hair in Clarisse

Unread postby dane » Tue Aug 20, 2019 12:01 pm

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: https://www.youtube.com/watch?v=Za-eBewyqbM 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
dane
 
Posts: 98
Joined: Wed Aug 29, 2018 11:50 am

Re: Xgen hair in Clarisse

Unread postby gdoublet » Tue Aug 20, 2019 1:38 pm

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.

Regards,

-Gabriel
User avatar
gdoublet
 
Posts: 9
Joined: Mon Jul 02, 2018 2:24 pm

Re: Xgen hair in Clarisse

Unread postby dane » Tue Aug 20, 2019 3:00 pm

Perfect! Thanks for that, exactly what I wanted
dane
 
Posts: 98
Joined: Wed Aug 29, 2018 11:50 am

Re: Xgen hair in Clarisse

Unread postby esmith » Tue Aug 20, 2019 5:08 pm

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......
User avatar
esmith
 
Posts: 164
Joined: Mon May 22, 2017 4:11 pm

Re: Xgen hair in Clarisse

Unread postby dane » Tue Aug 20, 2019 5:39 pm

Legend! That would be great to test out, much appreciated esmith!
dane
 
Posts: 98
Joined: Wed Aug 29, 2018 11:50 am

Re: Xgen hair in Clarisse

Unread postby esmith » Tue Aug 20, 2019 8:19 pm

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.

LETS GO!!!!

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


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


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


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.
Capture3.PNG


That process will generate a new asset in your outliner
Capture4.PNG
Capture4.PNG (7.86 KiB) Viewed 1991 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
XGenInteractiveGroomDescription_Export_Alembic.png (3.72 KiB) Viewed 1991 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)
Capture5.PNG


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


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


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
CombineGuideCurves_AddATTR_Export_Alembic.png (4.11 KiB) Viewed 1991 times


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



AlembicExportSelection;
};

Capture8.PNG


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



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.
Capture10.PNG


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


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


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


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


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!
Attachments
XgenExampleSetup.zip
(11.81 MiB) Downloaded 101 times
User avatar
esmith
 
Posts: 164
Joined: Mon May 22, 2017 4:11 pm

Re: Xgen hair in Clarisse

Unread postby dane » Wed Aug 21, 2019 5:06 pm

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!
dane
 
Posts: 98
Joined: Wed Aug 29, 2018 11:50 am

Re: Xgen hair in Clarisse

Unread postby esmith » Wed Aug 21, 2019 6:10 pm

excellent, keep us posted and good luck Dane!
User avatar
esmith
 
Posts: 164
Joined: Mon May 22, 2017 4:11 pm

Re: Xgen hair in Clarisse

Unread postby dboude » Thu Aug 29, 2019 2:13 pm

This is an answer to a deleted post...

Hi,

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.

Image

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 ;)
Démian
Isotropix
Technical Artist - Clarisse Specialist
User avatar
dboude
 
Posts: 1349
Joined: Mon Jul 03, 2017 10:51 am

Re: Xgen hair in Clarisse

Unread postby dupevfx » Thu Aug 29, 2019 2:31 pm

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! :-)
dupevfx
 
Posts: 29
Joined: Mon Oct 01, 2018 6:08 pm

Next

Return to General Discussion