This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
layerUtils.h File Reference
+ Include dependency graph for layerUtils.h:

Go to the source code of this file.

Functions

 SDF_DECLARE_HANDLES (SdfLayer)
 
SDF_API std::string SdfComputeAssetPathRelativeToLayer (const SdfLayerHandle &anchor, const std::string &assetPath)
 Returns the path to the asset specified by assetPath, using the anchor layer to anchor the path if it is relative.
 

Function Documentation

◆ SdfComputeAssetPathRelativeToLayer()

SDF_API std::string SdfComputeAssetPathRelativeToLayer ( const SdfLayerHandle &  anchor,
const std::string &  assetPath 
)

Returns the path to the asset specified by assetPath, using the anchor layer to anchor the path if it is relative.

If the result of anchoring assetPath to anchor's path cannot be resolved and assetPath is a search path, assetPath will be returned. If assetPath is not relative, assetPath will be returned. Otherwise, the anchored path will be returned.

Note that if anchor is an anonymous layer, we will always return the untouched assetPath.