The AYON USD Resolver is
an asset resolver plugin
for Pixar's USD. It's designed to turn URIs with the
ayon://
or ayon+entity://
formats into local file paths.
This resolver uses local caching and connects with the AYON Server to handle AYON compatible entity URIs through the AyonCppApi.
[!IMPORTANT]\ This repository is a development repository and uses Git Submodules. Make sure to use the correct
git clone
commands accordingly.[!IMPORTANT]\ The AYON USD Resolver is a AR2.0 resolver and will not support packages that only support AR1.0
[!NOTE]\ Building and testing is now done with Houdini 19.5 and Houdini 20. More packages will be available soon. To build against the "standalone" USD framework you need to either comment
include(BuildPlugins/${SelectedCompilePlugin}.cmake)
line inCMakeLists.txt
or build you own build plugin inBuildPlugins
.
```
git clone --recurse-submodules https://github.com/ynput/ayon-usd-resolver.git
git submodule update --init --recursive
```
AYON will provide some pre-built versions of the resolver in the future.
Those versions will be the pre-built binaries that our tests created, so you might not find your software/platform combination.
It's also to be expected that resolver builds are behind new software releases.
Currently, we only support specific set of DCCs and their versions, and AyonUsd for building revolvers (other software packages and stand-alone setups will follow).
Currently, building the Resolver centers around a build script .sh(Linux) .bat(windows). The Linux build script is more elaborate than the Windows script because resolver development is currently done on Linux, so the build.sh carries extra functionality around.
build.sh
script. (they are all
grayed out)HOU_VER
= Set this to the number of your Houdini version.
COMPILEPLUGIN
= In the repository root, you'll find a folder called
BuildPlugins
. In this folder, there are .cmake scripts that we call
BuildPlugins. You will have to set this variable to the path + name of this
build plugin as a relative path.
starting from the BuildPlugins
e.g. HouLinux/LinuxPy310Houdini20
INSTALLNAME
{Optional} = This is an optional variable that allows you to
override how the folder for the resolver will be named.
HOUDINI_INSTALL_DIR
{Optional} = this is an override for the install
directory off Houdini. If you don't set this, the script will assume that you
installed Houdini in opt/
with the base name of hfs
build.sh Clean
/ Clean
= Will delete and recreate the build and
Revolvers folder for a clean build setup.Resolvers/HouLinux/LinuxPy310Houdini20
build.bat
script.HFS
= this will be the Houdini install directory e.g
C:\Program Files\Side Effects Software\Houdini 20.0.590
COMPILEPLUGIN
= In the Reop-root, you find a folder called BuildPlugins
.
In this folder, there are .cmake scripts that we call BuildPlugins. You will
have to set this variable to the path + name off this build plugin as a
relative path starting from the BuildPlugins
, e.g.
HouWin/WindowsPy310Houdini20
build.bat
.Resolvers/HouLinux/LinuxPy310Houdini20
The Resolver needs a few Env variables to work, namely:
USD_ASSET_RESOLVER:
TF_DEBUG:
LD_LIBRARY_PATH:
PXR_PLUGINPATH_NAME:
PYTHONPATH:
AYONLOGGERLOGLVL:
AYONLOGGERFILELOGGING:
AYONLOGGERFILEPOS:
Inside AYON, you can use the Environment Field of your software version to define what resolver you want to use. Here is an example of how that might look:
{
"AYONUSDRESOLVER_ROOT": "/path/to/ayon-usd-resolver/Resolvers/{BuildPlugin path + name}",
"USD_ASSET_RESOLVER": "{AYONUSDRESOLVER_ROOT}",
"TF_DEBUG": "",
"LD_LIBRARY_PATH": [
"{AYONUSDRESOLVER_ROOT}/ayonUsdResolver/lib",
"{LD_LIBRARY_PATH}"
],
"PXR_PLUGINPATH_NAME": [
"{AYONUSDRESOLVER_ROOT}/ayonUsdResolver/resources",
"{PXR_PLUGINPATH_NAME}"
],
"PYTHONPATH": [
"{PYTHONPATH}",
"{AYONUSDRESOLVER_ROOT}/ayonUsdResolver/lib/python"
],
"AYONLOGGERLOGLVL": "WARN",
"AYONLOGGERFILELOGGING": "ON",
"AYONLOGGERFILEPOS": "LoggingFiles"
}
BuildPluingins Naming schema is as follows:
{AppName}{PlatfromName}/{AppName}{AppVersion}_Py{pythonVersion}_{PlatfromName}.cmake
PlatfromName options = {Win, Linux, Mac, specific Os Name}
On USD Init:
ResolverContextCache
and a
globally accessible
shared_ptr will be
createdWhen a USD file is opened:
Resolver Context is created.
ResolverContextCache
When a USD AssetIdentifier is found.
_Resolve()
gets called with the data between the
@ symbols._Resolve()
checks if the path is an AYON URI path.
getAsset()
function in the
ResolverContextCache
.ResolverContextCache
will then first check the PreCache and then the
Responsible cache. If the ResolverContextCache
finds the asset, it will
be returned as a struct. If the ResolverContextCache
does not find an
asset, it will call the AyonCppApi and request the asset information
from the server.The AssetIdentifier or AssetPath is always used by the resolver to convert an AYON path to a path on disk. The resolver needs some information in the path to figure out what asset you want.
ayon:
is used in the _resolve()
function to know whether your asset is an
AYON asset or not (done via a string view comparison).
//{ProjectName}/{path/to/ayon/folder}?product={FileName}
This is a classic
AYON path that defines what Ayon folder you want, e.g., sequences/sh010,
assets/characters/bob, etc.
version=latest
version has multiple options:
latest
: Will tell the resolver to use the latest version no matter what.hero
: This will tell the resolver to find the pinned hero version (you
should know that you have the option to set up your AYON server without
hero versions; in this case, the resolver will not be able to find your
product version).v001
(or whatever you put in your template): Will allow you to use a
specific version of the product.representation=usd
: This part of the path is very important; it sets the
file "extension" that the resolver will search for. You can use everything
that you can upload to the server.
All together, you will get an asset path like this. This asset path can be used inside of USD and will be resolved by the asset Resolver.
ayon://{ProjectName}/{path/to/ayon/folder}?product={FileName}&version=latest&representation=usd
[^1]:
In the CPP files, you might find TF_DEBUG().Msg();
and one of the two
Enum Values AYONUSDRESOLVER_RESOLVER
or AYONUSDRESOLVER_RESOLVER_CONTEXT
these allow you to select what debug messages will be printed. If you want the
resolver to be silent, then you can leave this value empty. It's best practice
to keep it in your env variable setup, just in case.