arnold-usd icon indicating copy to clipboard operation
arnold-usd copied to clipboard

Cannot open textures inside a usdz file

Open trebconnell opened this issue 4 years ago • 4 comments

Arnold encounters error when loading a usdz file that has embedded textures.

To Reproduce

  1. Download usd test file simpleMaterial.usdz
  2. Run: usdview --renderer Arnold simpleMaterial.usdz
  3. Get error ERROR | [texturesys] Image "C:\Users\treborc\Documents\usdme\pxr\usd\lib\usdUtils\testenv\testUsdUtilsCreateNewUsdzPackage\nestedUsdz\simpleMaterial.usdz[0/USDLogoLrg.png]" does not exist. Also, it is not the name of an image format that OpenImageIO recognizes.

Expected behavior Able to open the usdz file without errors and load texture

Used Software Versions

  • Arnold: [5.4.0.0]
  • USD: [0.19.11]
  • Compiler: [MSVC 2017]
  • OS: [Windows 10]

trebconnell avatar Nov 26 '19 23:11 trebconnell

These textures are most likely accessible through ArAsset, which either reads the contents into memory or provides a filehandle and an offset to access the file data.

There are two approaches, either using temporary files or passing the file data directly to an image node. I'm not a big fan of using temporary files for something like this. For example, there isn't a clear API that gives you a temporary file and still guarantees removal even in the case of a hard crash on Linux.

If we pass the image data directly to the image node in arnold, we can either use a unit8_t[] similarly to the openvdb volume or pass the raw file handle.

The advantages of the filehandle and the temporary file approach is that we can still take advantage of OIIO's lazy loading, so that would be way more efficient than loading all the texture to memory.

sirpalee avatar Nov 28 '19 11:11 sirpalee

Hi there

Is there any ETA for this to be picked up? It's currently blocking development of a pipeline project at our studio.

Alternatively, if someone could give some tips for a good starting point I'd be happy to give this a go myself.

Regards

dalorin avatar Dec 11 '20 13:12 dalorin

Hi again

It'd be great to know if this is on the roadmap. I've developed a patch that decompresses the USDZ archive and rewrites the file path to point to the temp location, but there's almost certainly a better solution using ArAsset. I'm just not sure how to pass a file handle when a file path is expected.

Regards

dalorin avatar Jul 13 '21 16:07 dalorin

Hi there, me again

I'd really love to get this implemented. It's one of the major remaining impediments to the way we'd like our pipeline to operate. Any chance of getting this on the roadmap?

Regards

dalorin avatar Jun 29 '22 11:06 dalorin

Issue synced internally to ARNOLD-13226

Hi, Closing this ticket are Arnold 7.2.5 is now able to read usdz with textures. https://help.autodesk.com/view/ARNOL/ENU/?guid=arnold_core_7250_html

cpichard avatar Feb 16 '24 11:02 cpichard