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!
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.
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.