Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

xGen export alembic/ASS file for Arnold

Anonymous

xGen export alembic/ASS file for Arnold

Anonymous
Not applicable

Hello,

 

So I have a character for which I've created a collection with several descriptions to make up his hairstyle. I want to keep the project clean and leave xGen on its own file in case there needs to be changes, instead of making the changes in the light scene itself. So my question is, is there a way to create an alembic file with the xGen collection in it, in which I can just import into a new scene and have it render as a proxy? 

 

I tried doing this different ways, like manually trying to export an arnoldStandIn, resulted in an unrenderable result and this: 'Error: line 1: XGen:  Failed to open file and the fallback attempts also failed: E:/Projects/CP/Character/Model/maya/hairHead_07__collection.abc' 

 

I also tried exporting patches for batch and it did create an abc file but couldnt get it into a scene as a clean proxy.

 

I also tried creating an alembic cache but resulted in importing my collection name with the description groups empty.

 

Is there a workflow around this? or do you must have the whole collections editable in the scene and cannot be rendered as a proxy/alembic file?

 

 

Thank you!

0 Likes
Reply
7,962 Views
8 Replies
Replies (8)

Michael_Todd
Alumni
Alumni

Did you turn on "Expand Procedural" on the ASS file export options?

 

ASSExport.png

 

ASSRender.png

 

You dont even need the geo in the scene:

 

ASSRender2.png

 

 

The hair won't show in the ASS file preview but it will show in the render.

ASSShadedPolyWire.png

 

You can export the ASS file with animation as well and the hair will follow the animated geo. You will get an ASS file per frame, though, and the space that they can take up may vary depending on the amount of geo in the original scene.

 

Each of these tigers (47,000 in the full shot) is an animated Arnold Standin, instanced as Archive objects in Xgen.

 

ASSTigers.gif

 

Cheers

 

 

 

 

 

 

 

 

 



Michael Todd

XGen Product Owner and Designer

0 Likes

Anonymous
Not applicable

Hello, 

 

Is there any preparation to the scene that should be done? Are you selecting the mesh and the Collection entirely, or anything specific within the Collection?

I'm following the steps as shown in the screencaps but the Arnold Stand-in I get is empty. I don't have much experience with xgen so I'm not quite sure why that's happening. Any ideas are welcome. 

 

Many thanks, 

Hana

TuringFox
Participant
Participant

For future reference, as this really badly documented by Autodesk. Personally I couldn't get the hair to render in batch in Arnold directly even though I baked the curve animation, set the renderer to batch mode, etc. It just renders static hair (attached to the scalp) when I render in batch.

 

The only way I was able to get the hair to render with animation was to do the following:

 

- Select the collection (not sure if it works for individual collections, didn't try).

- Go to Maya main File menu and select export selection.

- Chose the ASS format and as described above don't forget to click "expand as procedural".

- Then set sequence export on, start end frame, path, etc.

- Export

 

On my end, Maya freezes on the last frame exported? I had to "crash" maya and restart.

 

- Re-open your maya file

- Delete everything that's hair related (sim, collection, etc.)

- Go to Arnold -> Standin to create a StandIn node

- Set the path to the ASS file and select sequence.

 

Beside some issues with exporting the ASS files in a first attempt (the bboxes was not right, I had to create a Maya file from scratch and reimport the collection), it seems to work.

 

It would be great to have seen this workflow documented somewhere. Also Arnold rendering in Batch directly from Xgen doesn't work. It seems like a bug to me, at least certainly not documented.

0 Likes

MIKKIROSE
Observer
Observer

Hi there! I'm having the same problem you described @TuringFox, I've been trying to render a simulated XGen groom in Arnold and am only getting a static groom that moves along with the animated character without the simulation I have on it. I can see the simulated hair in still frame renders but get static hair when I batch render. I have exported the patches for batch render, my simmed guides are all cached out using nCache and attached to the XGen groom through an anim wires modifier, and in the Preview/Output settings I have Render, Arnold Renderer, and Batch Render selected. I agree with you that batch rendering XGen grooms in motion does not seem to work in Arnold and is pretty frustrating!

 

I've tried what you suggest here, exporting the collection as a sequence of ASS files and bringing them in through a standin object, but I am still not getting motion that way. I wondered if I missed something you said? Here's what I did:

 

  • From my original file with cached sim applied to groom, I selected the collection name in the outliner (not the description, is that correct?)
  • File->Edit->Export Selection, in the options I have it set to ASS Export, Expand Procedurals is checked on, and I've set the Start and End frames. 
  • Click Export Selection, put it in a folder inside my project directory, give it a file name, Export Selection. 
  • It writes out a sequence of .ass files. 
  • In that same file (I've also tried it saving a new version of the file and reopening first), I delete out the XGen groom and nHair system I originally created it with, leaving just the cached out animated body geo and lights.
  • Arnold->Standin
  • On the aiStandIn object created, navigate to the first frame of the sequence of .ass files, check on Use File Sequence. 
  • A bounding box appears in the viewport. 
  • In local one frame renders I get static hair, same when I batch render.   

Did anything in there seem incorrect to you? Thanks for your help!

0 Likes

TuringFox
Participant
Participant

Hi @MIKKIROSE 

 

First all let me say I sympathize. Xgen while having lots of amazing qualities is also broken in many places.

 

So thanks for making the effort of reporting your steps carefully and completely. The problem is that I don't see anything wrong in your steps or anything I wouldn't have done myself. So I am not sure what to advise here. What I would do is insure that you have actually really baked out your animation.

 

  • From the Xgen menu export the patches. Not sure if this is necessary since it's no where explained what it's supposed to do but well, it can't harm you. 
  • I don't think if you use StandIns that you need to set any of the batch stuff but again better be on the safe side. For a lack of better option.
  • Select the curves (note that this works with the method that doesn't use AnimWire, I will check AnimWire today and will let you know later), and bake them to alembic. Then go to Xgen and in the animation section, uncheck the live option and set the path to your alembic cache. You should be able at this point to delete nucleus, follicles and hair system nodes. I assume you could also delete the curves since normally the motion of the guides should be driven by the abc cache, but oh well... At least if you delete the hair system, etc and that your guides are still moving at this point, it's good.
  • Then yes you are *right* you select the collection node (though I assume it also works for descriptions) and do the baking to ASS file like you described. The Expand Procedural option need to be checked indeed. Now again for me the process of exporting totally blocks Maya and hangs on last frame, forcing me to kill Maya and restart. Super.
  • Then delete all hair related stuff from the maya scene and import the StandIn selecting the sequence option indeed. You should see the BBox moving in the scene (assuming your hair are moving). If not ... well I empathize even more.

 

So I didn't describe more than what you did describe yourself but I wanted to be sure that your baking our of the animation actually worked. I would say this is step 1 in your check list. And again this worked for me using the animation method that doesn't use AnimWire modifier (which also seems to be fundamentally broken).  But I will check if this workflow works with AnimWire.

 

I'd say Maya scenes setup with Xgen nodes are extremely flaky to say the least. I had on numerous occasions unexpected behaviors, bugs and countless ambiguous error messages. The only solution I had to keep making progress was to start from scratch, reimporting a collection. 

 

I will post an update once I tested the AnimWire approach. Oh another last advice. Maybe test your pipeline on a good old sphere to see if you can get it working with this. If this doesn't work still on a simple replicable setup then it's likely not to be working at all. And then what can I say ... empathy won't be enough...

 

 

 

0 Likes

TuringFox
Participant
Participant

@MIKKIROSE 

 

See also:

 

https://forums.autodesk.com/t5/maya-forum/arnold-xgen-animated-hair-rendering-workflow/td-p/11073862

 

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. 

 

 

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, unchecked live, and set the path for the guides to your Alembic file.

Good. Now go to your Preview/Output tab.

 

  1. Not sure if this necessary at all but by 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 check a few more options.

jeancolasprunier_0-1648732203532.png

 

Now save your scenes. If I didn't miss anything and that you are luck, 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 seperate 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 where 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 cool. 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-1648734883515.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 file as a StandIn.

 

Pfeu...

 

jeancolasprunier_2-1648732856244.png

jeancolasprunier_3-1648732910404.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. The problem is 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 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 AWFUL 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 which 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 Likes

MIKKIROSE
Observer
Observer

Hi @TuringFox ! Thank you so much for updating this thread with all of this information! I apologize for my slow reply, I had to keep moving forward with the class I was teaching this to so for a quick work around I had them convert their grooms to iGroom to batch render, which does seem to work but loses some of the shading options they used in legacy XGen. I've just tried the Use Animated Guide method you outlined (rather than the Anim Wire) I used before and I still did not get moving hair in my batch render. I'm going to create a brand new example tomorrow and try it from scratch in a clean scene. I'll report back either way what I'm able again. Thank you for your help!

0 Likes

TuringFox
Participant
Participant

@MIKKIROSE You're welcome. I am curious to know if this worked for you. The problem is that there's often a lot of steps and it's easy to miss one. If you haven't done so, be sure it works with something simple first, and that you can repeat the steps with reliable results.

 

I am testing this workflow on a complex shots (1500+ frames) and while I do have many many problems of all kind, it seems to be working so far at least technically. Artistically it's another problem).

0 Likes