Unity-Technologies/usd-unity-sdk

"Import as GameObjects" errors out with Timed out on large files / large number of vertices (USDU-280)

cauberthonda opened this issue · 6 comments

When working with larger (150+ mb) USD files and importing as GameObjects in an interactive session, we keep getting this error:

Timed out while waiting for thread

This happens with USDA or USDC files in Unity 2021.3.7f1 using USD 3.0.0-exp2 on x64 Windows.

Anyone else run into this? Is there a workaround?

@cauberthonda Thank you for reporting, I haven't seen this before. Do you have a representative file you could share to help us to reproduce the issue?

I can't share the original proprietary mesh but I made a very simple file that causes the same issue. In Maya, create 8 cubes, polysmooth to level 8, created a total of 3147528 faces, export to usd using Arnold-USD. The file is here:

https://www.dropbox.com/s/l7av2u2fdw4vajb/cubesphere.usd.zip?dl=0

When I "Import as GameObjects" I get the same timed out error

Looks like it stopped working in the 3.0 release. The sanitization process is timing out (>1s) while processing the mesh. The (long) sanitization kicks in because st and normals attributes are of faceVarying interpolation (per vertex per face) which prompts us to unweld every faces of the mesh to get consistent array sizes. Raising the timeout value here will limit the issue but it might be worth looking into optimizing the sanitization as well.

Hey @cauberthonda this should now be fixed by #343. We've optimized the code and increased the timeout so this shouldn't happen for much larger meshes, but we're aware this won't be a complete fix. Please let us know if you still have the issue :)

Hey @cauberthonda! You can get the latest changes on the dev branch of this repo. Include this in your project by either cloning this repo and adding it as a local package, or you can add it via Package Manager using the Git URL, eg: “https://github.com/Unity-Technologies/usd-unity-sdk.git?path=package/com.unity.formats.usd”