Alembic Export problems in Ornatrix Maya

 
 
 
Posted by:madguru
Data created:19 September 2019

Hi,

loading alembic hair sims in the animCache operator is giving me incorrect results, with the hair still connected at the root, but shooting off in the wrong direction/shape.

I exported the guides from Maya, by selecting the top Ornatrix Operator and using the Ornatrix Alembic Export. Curves look correct when I reimport them using the regular Maya alembic import. If I take those same static curves and load them in the file with the animated character, the hair shoots off, with the roots still intact. If I import the alembic in that scene, the alembic curves looks fine. The same thing happens if I sim those exported curves and bring back the resulting alembic. There seems to be some issue here with how I am exporting the curves.

I tried different up axis values X, Y, or Z. Y would be the correct one. Each time the hair came in incorrectly, shooting off in different directions. To get just the guides for export, I turned off all modifiers including and after hair from guides. The alembic curves look fine when brought in as an alembic import, but not when loaded in the animation cache modifier, which I have placed just before the hair from guides modifier. I tried exporting with all export components checked and unchecked, with world coordinates checked and not and format set to Ogawa and HDF5 and none of these options worked (with use render version unchecked).

I have successfully used this workflow in 3ds max for simming in maya and houdini, but I don't know what is wrong here. I can't upload a file unfortunately.

 

Any thoughts?

 

Thanks,

 

Adnan

 

 

Hi Adnan,

Is difficult to know what's wrong without the files. Are you using a recent build of Ornatrix? Otherwise please update to the latest one and try again. If the problem persist please attach a screenshot of your Alembic Export settings. 

Jeordanis Figuereo (Product Designer. EPHERE Inc.)

Thanks for the reply Jeordanis.
 
I tried to create a simple example file to illustrate the problem, but the simple version works fine. I created hair on a plane, exported curves as alembic, simmed in Houdini and brought back in an animation cache modifier before hair from guides and it worked fine.
 
On the actual character, I bring the simmed curves back in from Houdini and the orientation and shapes are wrong on all hairs. I can import the non simmed alembic curves and simmed curves into maya and blendshape between them without issue. What else about the curves or groom could cause this? In the AnimationCache modifier I can click Overwrite Input and set Display Fraction to 1 to display the curve correct at that modifier level. If I go to the Hair from Guides after that, it is incorrect again. I can unclick remember roots and click it back on and the hair looks right again.
 
In the simple plane test it works without all of this. There must be something different about this groom or the curves.
 
Before working with remember roots off and on again, I get the following errors in the maya script editor:
 
Ornatrix: Control [editGuidesOption1] doesn't exist
Ornatrix: Control [editGuidesOption2] doesn't exist
Ornatrix: Control [editGuidesOption3] doesn't exist
 
as well as
 
Error: Ornatrix: Cannot generate strand 150 because it has a non-existing guide dependency
 
(It does this for all curve, not just 150)
 
Any idea what this problem could be? Thanks.

Hello,

I'm working with Adnan on this issue. We worked out a manual process that would enable us
to plug-in an alembic cache to the AnimCache node, that would then update the hair and 
allow us to render. I've scripted that process to make it a bit faster for characters requiring
multiple caches.

We are taking a number of steps that do not appear to be necessary, but will work if we do them.
Through the script, I can also replicate conditions under which we can reliably crash a file, and 
we have found a work-around for that crash, too. 

That's an overview of where we are at.

As MadGuru previously mentioned, we export the guides using the Ornatrix alembic export option. 
We leave those at the defaults, though we tried a number of options that did not seem to help.

After animating/simulating the exported curves, we plug those back into the Ornatrix AnimCache node.
In order to make this "take," we do the following for each Ornatrix AnimCache node:
* get stack associated with an AnimCache
* turn off attribute "rememberRootPositions" on any HairFromGuideNode in the stack
* turn off attribute "guideAreaCircleThroughNearest" on any HairFromGuideNode
* disable all nodes above a given AnimCache
* disable the AnimCache node
* set AnimCache "filePath" attribute to point to our moving alembics
* set "overwriteInput" on the AnimCache
* set "displayFraction" on the AnimCache
* enable the stack above the AnimCache
* enable "guideAreaCircleThroughNearest" on associated HairFromGuideNode
* enable "rememberRootPositions" on associated HairFromGuideNode

The script will also:
* open the Ornatrix Operators Stack if it is not open
* close the Maya Attribute Editor if it is open

After doing this, the hair looks appropriately deformed and will render. However, the
scene file itself is unstable. We see errors like this in the Maya script editor:

// Error: OxGetStackNodes; // 
// Error: Line 1.16: Wrong number of arguments on call to OxGetStackNodes. // 
// Error: OxIsStackShape; // 
// Error: Line 1.15: Wrong number of arguments on call to OxIsStackShape. // 
// Error: OxGetStackNodes; // 
// Error: Line 1.16: Wrong number of arguments on call to OxGetStackNodes. // 

Sometimes this as well:

// Error: OxIsStackShape; // 
// Error: Line 1.15: Wrong number of arguments on call to OxIsStackShape. // 
// Error: OxGetStackNodes; // 
// Error: Line 1.16: Wrong number of arguments on call to OxGetStackNodes.

Selecting either the hair in the viewport or simply clicking on nodes in the Ornatrix Operator Stack
will reliably crash Maya, when these errors appear. They do not appear if we change just a single
hair group. They appear when we do multiple.

If, however, we immediately save the file, open an empty Maya session, and re-open the file,
we are just fine.

Many of these steps seem unnecessary. For example, enabling "overwriteInput," we would think,
would be unnecessary if the curves were originally exported from Ornatrix. The topology
should match. Resetting "rememberRootPositions" also seems unnecessary.

What we see in the script editor when we do get a crash:

 

Hello guys,


I received your email. Let's keep talking over there to organize a call so I can work on the scene remotely. Then we can post the answer here for everyone to see.

Jeordanis Figuereo (Product Designer. EPHERE Inc.)

Hello Jeordanis,

Thank you so much for looking into this issue! We will test out the proposed work-around that you sent us--which does look much more simple than the steps we were taking. We appreciate your help with this!

You are welcome.

The bug is in AnimationCache operator and we are looking into it. For other users having the same issue at the moment, use the following workaround: 

  1. Collapse the guides (Below HairFromGuides) to BakedGuides
  2. This will create a BakedGuides operator with the guides collapsed and the roots attached to the distribution mesh. Select this operator, go to the attribute editor and load the alembic cache in the File Name parameter. The guide roots may be in a different location now because the animation is not included yet. 
  3. Select the AnimationCache operator and load the alembic cache again to load the animation. Now the guide roots are in place and the hair looks exactly as the original, the animation should also play well. 
  4. (Optional) Now the alembic cache file is being loaded twice: One by BakedGuides and second time by AnimationCache. Also the guides are now stored outside of the Maya scene. If you don't want that select BakedGuides and repeat step 1. 

Jeordanis Figuereo (Product Designer. EPHERE Inc.)