ynput / ayon-usd-resolver

Home of AYON USD resolver plugin
Apache License 2.0
5 stars 0 forks source link
ayon usd vfx-pipeline

AYON USD Resolver

Introduction

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 in CMakeLists.txt or build you own build plugin in BuildPlugins.

Requirements:

Tested Platforms:

Download the repo and its submodules:

```
git clone --recurse-submodules https://github.com/ynput/ayon-usd-resolver.git

git submodule update --init --recursive
```

Pre-build / Self Compiled

Prebuild

Self Compiled

Core concepts

  1. 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).

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

Linux Build Steps:

Varlibes:

starting from the BuildPlugins e.g. HouLinux/LinuxPy310Houdini20

Next Steps {in the Terminal}:

Windows Build Steps:

Variables:

Next Steps {in the Terminal}:

How to get the resolver working with Houdini and AYON

General.

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"
}

Developer Information

BuildPluingins Naming schema is as follows: {AppName}{PlatfromName}/{AppName}{AppVersion}_Py{pythonVersion}_{PlatfromName}.cmake PlatfromName options = {Win, Linux, Mac, specific Os Name}

Resolver Behavior:

On USD Init:

When a USD file is opened:

When a USD AssetIdentifier is found.

Asset Identifier / Behavior:

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.

  1. ayon: is used in the _resolve() function to know whether your asset is an AYON asset or not (done via a string view comparison).

  2. //{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.

  3. 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.
  4. 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.