Unable to Find Plugin for Custom Asset Resolver in wasm-USD at Runtime

Hello!

I’m trying to add a custom asset resolver on top of the Autodesk webgpu USD fork. I have an error that my asset resolver plugin is not found when running the code in the browser.

This is my current error:

  • Coding Error: in _GetPluginForType at line 193 of /Users/andrewbeers/git/projects/emscripten/webgpu/USD/pxr/usd/ar/resolver.cpp -- Failed to find plugin for HttpResolver

Trace:

  • The error comes from _GetPluginForType, which first calls _RegisterAllPlugins, _RegisterAllPlugins calls _RegisterPlugins, which calls Plug_ReadPlugInfo which recursively searches /usd/ and /usd/plugin/ for plugInfo.json files. This does not find my plugInfo which is a problem because finding it would populate an entry in _classMap which would then find a valid value in the dictionary for the HttpResolver type, which would then avoid the error and keep progressing through the code.

The type of HttpResolver itself is correctly discovered by this line and I see the plugInfo.json file in the new emHdBindings.data file here and here, not a great link, but if you search from httpResolver you can see that it’s mapped to usd/httpResolver/resources/plugInfo.json. This matches the form of usdGeom which is /usd/usdGeom/resources/plugInfo.json which loads fine. It’s not clear to me what is different. The plugin paths that are searched for plugInfos are /usd/** and /usd/plugin/** so I’m not sure why my asset resolver plugInfo.json is not found.

Looking for any insights on what I might be configuring wrong with the plugInfo.json json in my CMakeList.txt (AssetResolver CMakeLists.txt, wasm-usd CMakeLists.txt) or elsewhere.

My current overall code state:

  • Commit to add a dummy asset resolver and get it building with the wasm build: here
  • Commit of the newly generate wasm files from the commit above, in a testable repo: here

Thanks for any help!

Thank you @andybeers for trying Autodesk WebGPU branch. There is a ArResolver plugin example maybe you would like to follow up to check problem. USD/extras/usd/examples/usdResolverExample/plugInfo.json at adsk/feature/webgpu · autodesk-forks/USD · GitHub . And you could print log in browser console of developer tool for locating the problem. Hope it is helpful.

Thanks @wangfr ! Double checking that showed that I had the wrong formatting on my plugInfo.json. Really appreciate the link!