# Asset Resolution

As of version 7.0.0 Multiverse supports Asset Resolution 2.0 for USD assets . This feature is useful for users and organizations which rely on a more structured pipeline, for more information please read AR 2.0 (opens new window)

The name of the asset resolver plug-in to use can be set through the MV_USD_ASSET_RESOLVER environment variable.

Note

This variable has to be set before the Multiverse plug-in is loaded and cannot be changed within a running Maya session.

If Multiverse detects that the MV_USD_ASSET_RESOLVER variable is set, it will print a message on the console, e.g.:

// Multiverse: using 'ArDefaultResolver' asset resolver

As of version 8.0.0 Multiverse ships with an additional resolver called "Simple Asset Resolver".

# No explicit resolver

If the MV_USD_ASSET_RESOLVER is not set, Multiverse will treat asset paths as simple files - this is equivalent to the resolution mode used by previous versions of Multiverse.

  • USD files loaded into Multiverse Compound nodes are treated as files. The Use Relative Path option available in the asset loading UI and in the API controls if the value stored in the Maya Multiverse Compound node is an absolute path or a path relative to the current Maya project.

  • References to USD files stored in compositions are always treated as relative paths.

# Using the default USD resolver

To use the default USD resolver the MV_USD_ASSET_RESOLVER environment variable needs to be set to ArDefaultResolver:

On macOS/Linux:

export MV_USD_ASSET_RESOLVER=ArDefaultResolver
1

On Windows:

set MV_USD_ASSET_RESOLVER=ArDefaultResolver
1

Note

If MV_USD_ASSET_RESOLVER is set, the Use Relative Path option (opens new window) in the Multiverse loading UI will be grayed out.

The ArDefaultResolver plug-in (opens new window) also treats asset paths as filesystem paths. Asset resolution is performed by searching for an asset in a specified list of directories. The directories to use for asset resolution can be defined through the PXR_AR_DEFAULT_SEARCH_PATH environment variable, for example:

on macOS/Linux:

export PXR_AR_DEFAULT_SEARCH_PATH=//server1/data/path1:/path/to/folder
1

on Windows:

set PXR_AR_DEFAULT_SEARCH_PATH=X:/data/path1;Y:/data/path2
1

Important

The order of the paths set in the variable is respected by the plug-in when resolving an asset. If an asset can be resolved into a file that exists in more that one folder, the first one will be used. In the example above, assets will be first searched first in //server... and then, if not found, in /path/to/folder.

If the PXR_AR_DEFAULT_SEARCH_PATH variable is not set, all asset paths will be treated as absolute paths. In this case Multiverse will print a warning message in the Maya script editor:

// Warning: Multiverse: asset resolver set to 'ArDefaultResolver' but PXR_AR_DEFAULT_SEARCH_PATH is not defined

Notice that Maya scenes previously saved with assets encoded using relative paths will not resolve correctly in case the ArDefaultResolver is used and the search paths set in PXR_AR_DEFAULT_SEARCH_PATH don't match the loaded assets. Likewise compositions which reference USD files won’t be resolved.

# Resolving assets in mixed O/S environments

Posix-like (macOS/Linux) and Windows have different conventions in terms of setting environment variables. When relying on PXR_AR_DEFAULT_SEARCH_PATH to resolve assets, make sure that each platform has its own values for it.

Assuming all the assets are then saved relatively to those path, all the scenes using such assets should resolve correctly, e.g:

Windows: PXR_AR_DEFAULT_SEARCH_PATH=Z:\Assets;Y:\Assets
macOS: PXR_AR_DEFAULT_SEARCH_PATH=/Volumes/Pollux/Assets:/Volume/Castor/Assets
Linux: PXR_AR_DEFAULT_SEARCH_PATH=/media/Pollux/Assets:/media/Castor/Assets 
1
2
3

Note the delimiter on Windows ; and on Posix : and \ vs /.

# Using a custom resolver

Multiverse also supports custom asset resolvers. Custom resolvers are implemented as C++ Ar plug-in using the Pixar USD Ar API (opens new window). To use a custom asset resolver plug-in (for example CompanyXYZResolver) simply set MV_USD_ASSET_RESOLVER environment variable to the resolver name:

On macOS/Linux:

export MV_USD_ASSET_RESOLVER=CompanyXYZResolver
1

On Windows:

set MV_USD_ASSET_RESOLVER=CompanyXYZResolver
1

# Using the mvSimpleAssetResolver

Standard resolution prepends either the current working directory or Maya's workspace directory depending on the context, and this has worked wonderfully for years. If, however, you require unmodified filepaths passed around, this mvSimpleAssetResolver can be enabled by setting the environment variable:

On macOS/Linux:

export MV_USD_ASSET_RESOLVER=mvSimpleAssetResolver
1

On Windows:

set MV_USD_ASSET_RESOLVER=mvSimpleAssetResolver
1

No other options are needed.

This asset resolver allows you to use relative paths for creation and loading of assets, given that it passes filepaths un-modified.

Last Updated: 2/1/2023, 9:32:24 AM