Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Arnold Xgen animated hair rendering workflow

0 REPLIES 0
Reply
Message 1 of 1
TuringFox
1171 Views, 0 Replies

Arnold Xgen animated hair rendering workflow

I had problems rendering animated Xgen generated hair using Arnold. Ask a few questions with no reply. Ended up figuring out some of this thing out after few days of work, so thought I would share this with the community under a generic enough title that makes it easy to find in search.

 

This was also documented under these threads:

 

https://forums.autodesk.com/t5/maya-forum/xgen-export-alembic-ass-file-for-arnold/m-p/11073832#M9279...

 

https://forums.autodesk.com/t5/maya-forum/arnold-doesn-t-render-hair-after-a-few-frames-of-simulatio...

 

Here it is. 

 

Ok so here are my findings and hopefully this will help a bunch of people in the future, as I spent a couple of days on this. I re-iterate that Autodesk's docs on that process are pretty useless. Lack of tutorials coming form Autodesk.

 

Method 1: Using the Guide Animation Method

 

  1. Rewind your animation. Safety.
  2. Check Use Animation on the Xgen primitives tab. Keep Live Mode checked for now.
  3. Then click on Create Hair System. I personally found that use the selected geo as passive collider didn't work. It's better to add the Rigid Body nodes later on.
  4. Set the params on the Nucleus (Space Scale, etc.) and Hair System node (collision, ... see my settings below)
  5. Select geo (body, etc.) and add Rigid Body node (nCloth menu> Create Passive collider). Eventually set Collision Layer id if you have more than 1 piece of geo (hair should have max Collision Layer ID).
  6. Select all the curves (hairSystem1OutputCurves by default) and then on the XGen node (primitives tab, Guide Animation group) click on Attach Hair system.

You should be good to go. Play the sim. It sims. Lucky you. 

Settings (using 1 unit  = 1 cm).

 

 

 

setAttr "nucleus1.spaceScale" 0.01;
setAttr "nucleus1.subSteps" 20;
setAttr "nucleus1.maxCollisionIterations" 20;
setAttr "hairSystemShape1.collisionFlag" 1;
setAttr "hairSystemShape1.selfCollisionFlag" 1;
setAttr "hairSystemShape1.selfCollide" 1;
setAttr "hairSystemShape1.solverDisplay" 1;
setAttr "hairSystemShape1.collideWidthOffset" 1;
setAttr "hairSystemShape1.collideWidthOffset" 0.5;
setAttr "hairSystemShape1.solverDisplay" 2;
setAttr "hairSystemShape1.friction" 0.6;
setAttr "hairSystemShape1.stretchResistance" 300;
setAttr "hairSystemShape1.compressionResistance" 200;
setAttr "hairSystemShape1.bendResistance" 30;
setAttr "hairSystemShape1.startCurveAttract" 1;
setAttr "hairSystemShape1.mass" 0.1;
setAttr "hairSystemShape1.drag" 0.25;
setAttr "hairSystemShape1.damp" 0.25;
setAttr "hairSystemShape1.collisionLayer" 2;

 

 

 

Then comes the baking stage:

 

  1. Save your file. Then save it again by incrementing the version number. I found that caching the sim could destroy your Maya scene (sometimes)
  2. Cache you hair System. Select the node, go to nCache menu > Creat New Cache, etc.
  3. Uncheck "enable" on your nucleus node, you should still see the sim but now can scroll freely
  4. Then select the curves, then cache them out to Alembic file
  5. Then go to Guide Animation on the Xgen Primitives tabe, uncheck the live option, and set the path for the guides to your Alembic file.

Good. Now go to your Preview/Output tab.

 

  1. Not sure if this is necessary at all but for safety, go to File Menu of Xgen tab and then Export Patches for Batch Render. Be sure to check the Animation check box. Set start, end, etc.
  2. Set Operation to Render, Renderer to Arnold, click on the Auto Set button of the Prim Bound. Not sure if it makes any difference. But then if not why is the button there?))
  3. Render Mode to Batch Render.
  4. Not sure whether this makes ANY difference, but I checked a few more options.

jeancolasprunier_0-1648732203532.png

 

Now save your scenes. If I didn't miss anything and that you are lucky, you should be able to render in batch.

 

Additionally:

 

  1. Select the curves (not sure this useful) and the collection / description nodes (and guides - not sure it's necessary).
  2. Then go to File > Export Selection and export this to ASS files. Be sure to check the Expand Procedurals options (by the way exporting the bbox breaks the content of the ASS file).
  3. Load the ASS files in separate Maya file & voila!

Method 2: Using AnimWire

 

  1. You can't create anim wire modifier in Xgen if auto update preview is ON. So turn it OFF first. When creating the wires I chose the guide option. I did get some problems when using the point distribution. But that's not the point of this post. Only the DEFAULT Control Map mode works for me btw. Then click on Preview Wires. You see them? Good. Then click on Create Hair Systems.
  2. Follow same steps as above for the hair system, etc. Including the baking steps.
  3. Then go back to Xgen, Anim Wire node. Be sure to REWIND the scene (first frame).
  4. Select the curves and do Attach Hair system.
  5. I set the rest of the params like so...

jeancolasprunier_0-1648734922873.png

 

As you can see I have baked the curves out to Alembic cache like in method 1, unchecked the live box, and set the path to the ABC file. You can see that the strands are following the wires ...

 

The rest is the same as with method 1. For the rendering part. Set the params to render in batch (see above) and then ... render in batch. This worked for me. Also you can export to ASS files and use that in another scene as a StandIn.

 

Pfeu...

 

jeancolasprunier_1-1648733713803.png

 

jeancolasprunier_0-1648733697234.png

 

 

I have to say this has been a really painful journey. Maya's docs are providing a description of what the params are doing but something like "Bake: Allows to bake the data" is not very useful unless you understand the workflow. Docs have 0 image whatsoever. It's a 3D software designed to make images!!! The problem is that Autodesk does not provide such documents. The video available whether form Autodesk or the community do not cover animation most of the times, and certainly not the rendering workflow in details. Which is what I attempted to do here.

 

I don't find it particular normal that it's up to the users to spend days to figure it out, not mentioning the bugs I found along the way (like caching out the sim to nCache breaks the file sometimes when you re-open it next, the weird stands staying up in the hair where you use anim wires, and list goes on and on). The workflow is rather difficult as you need to go through SO MANY STEPS before you eventually get to render something. A properly integrated system would allow you to sort of sim the guides or the wires directly. Assuming you can create the wires which is impossible right now unless you know you have to turn auto update off (that's clearly, not, a feature). You can't render in batch unless caching. I personally don't understand why. If you render the frames sequentially this shouldn't be necessary.

 

So anyway, hope someone at Autodesk will read that, but I doubt, and even if they do, I doubt they have enough power to change the way Maya works. Despite this, I have to say Xgen has really good qualities. The general problem is how flaky and convoluted the whole thing is.

 

Hope these explanations though will help users in the future. I wish I had found something like this. Would have saved me days of non productive work.

 

 

 

 

 

 

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report