Open Source Asset Resolver (AR2.0) for Ayon - Path Redirection Question

Open Source Asset Resolver (AR2.0) for Ayon - Path Redirection Question

Hello there,

I am currently working(still) on an Open Source Asset Resolver(AR2.0) for Ayon. One feature we want to implement is the ability to allow redirection of asset paths. Essentially, this would enable a setup where:

  • assetA = pathA
  • At runtime, a configurable setting allows this to change to assetA = pathB.

For the initial loading process, we intended to use the _CreateDefaultContextForAsset() function. This choice was motivated by the fact that Houdini uses this function to pass Resolver Context Asset Path.

However, @BigRoyNL recently discovered that Maya behaves differently. Maya always passes the “Source” USD file into this function, unlike Houdini.

This raises an important question:
Is this behavior in Maya intended, or is it inconsistent with the expected functionality?

I’d appreciate any insights or clarifications on this matter. Thanks in advance for your input!


Cheers,
Root42

3 Likes

Anyone here has any insights about this?

I’m very curious about the intended way of ‘configuring’ a USD Asset Resolver, e.g. in the context of Houdini, Maya and so forth. But it seems that Maya or Houdini ended up ‘doing it differently’.

Is the CreateDefaultContextForAsset always intended to be the root layer, or could it e.g. be a sidecar json file even? The way Houdini docs describe it with Resolver Context Asset Path makes it sound like it’s just any configuration file which doesn’t necessarily sound 1:1 tied to being the root layer or even a USD file to begin with but with Maya (as far as I could find) not exposing any such Resolver Context Asset Path as separate input file attribute on e.g. Maya USD proxy shape I’m a bit confused how that concept would translate to Maya.

For context, the configuration looking to be passed here is e.g. a dedicated mapping from one URI to another URI to switch versions or to pin e.g. a USD file to a specific version.

It seems to me like others have done that in the past - so feel free to chip in with your current approaches used in production and tell how that turned out.


Cross-referencing potential related topic:

1 Like

From ASWF Slack by Mark Tucker (SideFX):

I can only speak to the Houdini side… We have done our best to expose every possible mode of configuring asset resolvers, including allowing each LOP network or chain of LOP nodes to evaluate using a different asset resolver configuration. The tools to use here are parameters on the LOP Network and/or parameters on a Configure Stage LOP.

From a pure USD perspective, the “asset” in the “asset resolver context from asset” absolutely does not need to be the “root” USD file used to open the stage. And it doesn’t need to be a USD file at all. It can be anything.

The use of the “root” layer as the default asset for the resolve context stems from Pixar’s standard asset resolver, which adds the path in which the root layer lives to the “search path” used to resolve assets specified in “search path” format (relative paths that don’t start with “.” or “…”). So this is generally a reasonable approach if you are using the standard Pixar search path based asset resolver.